Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Format top row, but only non-blank cells
You can use Specialcells
On Error Resume Next Rows("1").SpecialCells(xlCellTypeConstants).Font.B old = True On Error GoTo 0 -- Regards Ron de Bruin http://www.rondebruin.nl "BillyRogers" wrote in message ... 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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Format top row, but only non-blank cells
here's what i did and it works....I took some code i found in an earlier
message and modified it slightly. Sheets("dbo_Corp10_Demographics_Volume_").Select Range("A1", Range("IV1").End(xlToLeft)).Select ''''''''Rows("1:1").Select-----I replaced this line with the one above With Selection.Interior .ColorIndex = 15 .Pattern = xlSolid |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Conditional Format for Blank Cells | Excel Worksheet Functions | |||
Maximum Number of Blank Cells between Non Blank Cells in a Range | Excel Worksheet Functions | |||
Conditional formatting: format when range of cells are blank | Excel Discussion (Misc queries) | |||
Blank Cells - conditioning format | Excel Discussion (Misc queries) | |||
How do I make a blank cell with a date format blank? | Excel Worksheet Functions |