Nils Zimmermann
Nils Zimmermann

Reputation: 21

Highlight Every other row that contains information in column A vba

I was hoping you guys could help me figure something out. I am trying to get excel to highlight every other row that contains any information in column A

so it would look like this:

img

I haven't been able to make any proper headway into this but I was hoping you guys might be able to give me some basic direction.

Upvotes: 1

Views: 212

Answers (2)

ashleedawg
ashleedawg

Reputation: 21619

Convert a range into a table in Excel:

You can make your range of data into a table (including auto-formatting):

  1. Select (highlight) the cells (including the heading if there is one).
  2. Hit Ctrl+T.
  3. Hit Enter.

image

There are several ways you can then customize your table, such as the options on the ribbon.

img2


More Information:

Upvotes: 0

FunThomas
FunThomas

Reputation: 29171

You can do this without VBA, just use conditional formatting.
Mark the Range, go to Conditional formatting, add a new rule with rule type "Use a formula to determine which cells to format" and enter

=AND($A1<>"",MOD(ROW(),2)=1)

(depending on the regional setting, you might have to exchange the "," with ";" - same syntax as a regular formula)

Then, click the "Format" button and select a fill color.

Upvotes: 1

Related Questions