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.


  1. xlf-blue-banner
    Fig 1: the xlf banner background applied to a worksheet

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.