View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
BillyRogers BillyRogers is offline
external usenet poster
 
Posts: 78
Default Format top row, but only non-blank cells

I have a macro that formats reports that I do and have given it to coworkers.
They don't want the "entire" top row highlighted. they only want the cells
they are using. The reports we run vary in the number of columns used but
the always start at cell A1 and run horizontally and don't skip any cells.
These are the column labels. Is there some routine that can detect how many
columns are being used and only format those columns in the first row?-
instead of formattingthe entire row?


Sheets("dbo_Corp10_Demographics_Volume_").Select
Rows("1:1").Select
With Selection.Interior
.ColorIndex = 15
.Pattern = xlSolid