Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
I have a report that has a different number of columns each day. I have the macro highlighting rows, 2 highlighted, 2 blank. But I only want the highlighting to extend to x number of columns. One problem is each data set has blanks in it, so I can't use the EndxlToRight for every row. I need to replace the "Z" in the statement Range("A1:Z2") with the x variable. Can you please help? Dim x As Long Range("A4").Select Range(Selection, Selection.End(xlToRight)).Select x = Selection.Columns.Count Range("A1").Select Do ActiveCell.Offset(4, 0).Range("A1:Z2").Select With Selection.Interior .ColorIndex = 15 .Pattern = xlSolid End With Loop Until ActiveCell.Offset(4, 0) = "" Thanks! Bret |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Formatting using Macro | Excel Discussion (Misc queries) | |||
Formatting for a Macro | Excel Discussion (Misc queries) | |||
Formatting via a macro | Excel Discussion (Misc queries) | |||
Conditional Formatting in Macro | Excel Discussion (Misc queries) | |||
Date Formatting in a Macro | Excel Discussion (Misc queries) |