Excel Macro help.

Dell INSPIRON 1520
February 18, 2009 at 11:36:21
Specs: Windows Vista, 1.66GHz/2.5GB
Hi all, I need help with an excel macro problem. I am creating what I thought was a simple scheduling macro. Basically I need to take batch residence times (a positive whole number) from cells in sheet1 and use these values to highlight that number of cells in a row on sheet2. I understand about recording a macro and can highlight the cells in this manner. However, I cannot figure out how to take the value from one cell and use it on another one to highlight that number of cells. Anyone out there who can help?

See More: Excel Macro help.

Report •

February 18, 2009 at 13:46:35
What do you mean by "highlight" the cells?

Do you want to select the cells or turn them a certain color or...?

Report •

February 18, 2009 at 18:41:12
Yes, turn the background a certain colour. Thanks for the reply.

Report •

February 18, 2009 at 20:47:18
Assuming a 6 in Sheet1!A1, this will fill Sheet2!A1:A6 with Green:

Sub ColorRange()
 Sheets(2).Range(Cells(1, 1), Cells(1, Sheets(1).Range("A1"))).Interior.ColorIndex = 4
End Sub

Hope that helps.

Report •

Related Solutions

February 19, 2009 at 13:40:41
Excellent, this works. Thank you very much.

Report •

Ask Question