/ Published in: Visual Basic

quick way to get column headers formatted
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
Public Sub Format_Headers(tgtRange As Range, Optional NoFill As Boolean, _ Optional ForceVertical As Boolean, Optional NoBold As Boolean) If tgtRange Is Nothing Then _ Exit Sub With tgtRange .Interior.Pattern = xlSolid .Interior.ThemeColor = xlThemeColorDark1 If Not NoFill Then .Interior.ColorIndex = 15 If Not NoBold Then .Font.Bold = True Else .Font.Bold = False .Borders(xlDiagonalDown).LineStyle = xlNone .Borders(xlDiagonalUp).LineStyle = xlNone .Borders.LineStyle = xlContinuous If Not NoBold Then .Borders.Weight = xlMedium Else .Borders.Weight = xlThin If Not ForceVertical Then .Borders(xlInsideVertical).LineStyle = xlNone End With End Sub
Comments
