Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dear Experts:
Below macro is used to apply an alternate fill to selected cells. I would like to get this macro changed to include also a specific fill for a HEADER row (selected cells at the very top), ... ie. the selected cells will also contain a header row. And these header cells should get the following fill: RGB(165, 165, 165), the font of this header is to be changed to bold and font color is to be changed to white. Help is much appreciated. Thank you very much in advance. Regards, Andreas Sub AltShade_GreyRed() Dim Counter As Integer If MsgBox("Would you like to apply an alternate shading to selected cells (grey/red)?", vbQuestion + vbYesNo, "Selected cells alternate shading grey/red") = vbNo Then Exit Sub End If 'For every row in the current selection... For Counter = 1 To Selection.Rows.Count 'If the row is an odd number (within the selection)... If Counter Mod 2 = 1 Then 'Set the color to ... Selection.Rows(Counter).Interior.Color = RGB(229, 229, 229) 'If the row is an even number (within the selection) Else Selection.Rows(Counter).Interior.Color = RGB(239, 211, 210) End If Next End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Alternate Shading for non-bold rows | Excel Programming | |||
How do I alternate shading of rows, Excel 2007, no new tabs. | Excel Discussion (Misc queries) | |||
Alternate Row Shading (Visible Rows Only) | Excel Worksheet Functions | |||
Color alternate rows when after hiding selected rows | Excel Worksheet Functions | |||
shading alternate rows, but losing format when one row is deleted | Excel Discussion (Misc queries) |