How can I tell Excel to highlight rows by their row number. For instance, let's say I wanted row 6, 10, 150, 201 highlighted. Thanks.
Here is another one based on Mote's
This one doesn't restrict you to enter the row numbers but gives the user the flexibility to choose the rows at runtime.
Yes there is a way. Let's say the list in Cell A1 to A10 then you can use this code
As an alternative to Motes' answer, you can use conditional formatting.
Eg: select A1:J500, Conditional formatting >> New rule >> Use a formula...
For the formula enter:
For basic VBA code, you can always start recording a macro, perform the action, stop recording, look at what code was generated, and then clean that up to do what you want. For example, recording the action of highlighting a row (setting the value of Interior.Color) gives you:
The selection commands and extraneous Interior properties can be removed giving you:
Adding in the row multi-select: