xlf | xlfAddBlueBanner
Add blue banner background to worksheet
Add the xlf blue banner background to a worksheet (figure 1), similar to the header background on this web page.
xlfAddBlueBanner - the VBA code
Code 1: Sub procedure
xlfAddBlueBanner add xlf blue fill colour to selected area of worksheet
Private Sub xlfAddBlueBanner()
Dim BannerRng As String, BannerRowHeight As Integer
'' Settings
BannerRng = "A1:N3": BannerRowHeight = 20
'' Code
Range(BannerRng).Select
With Selection
.Interior.Color = RGB(55, 95, 145) ' xlf blue banner fill colour
.RowHeight = BannerRowHeight
End With
Selection.Resize(1, 1).Select
'' Debug.Print "RGB(55, 95, 145) -> PatternColorIndex value: " & Selection.Interior.PatternColorIndex ' returns -4105
End Sub
Run the private procedure from the VBE. Use F5 or Run > Run Sub on the menu.
- This example was developed in Excel 2013 Pro 64 bit.
- Published: 18 June 2015
- Revised: Saturday 25th of February 2023 - 09:37 AM, [Australian Eastern Time (AET)]

