Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Change the row color

  Asked By: Techguy    Date: Oct 09    Category: MS Office    Views: 1106
  

I have a spreadsheet that has a number in column 1 then 2 or 3 rows
with nothing in column 1. Then a new number in column 1 with 2 or 3
rows again. I would like to change the background color of every other
row if it has a number in the first column so it is easier to read. I
can make every other row change, but this is not what I want. Is there
some VBA code I can add to do this automatically?

Share: 

 

2 Answers Found

 
Answer #1    Answered By: Julia Hughes     Answered On: Oct 09

could you write a for loop inside another for loop and try

 
Answer #2    Answered By: Scarlett Hughes     Answered On: Oct 09

If I understand, you want to change  the background color  of every row  that has a
number in column  A. You don't need VBA for this. Select all cells (click on the
box above the row numbers and to the left of the column letters). Select
Conditional Formatting from the Format menu. Select Formula Is instead of Cell
Value Is, and enter =COUNT($A1) in the formula box. Click the Format button, and
select the color you want on the Patterns tab. Click OK to close the Format
Cells dialog, then OK to close the Conditional Formatting dialog. When a number
is entered into any cell in column A, that row will be highlighted in the
selected color.

 
Didn't find what you were looking for? Find more on Change the row color Or get search suggestion and latest updates.




Tagged: