/simpleTblFormat.bas Secret
Created
May 5, 2020 09:55
Star
You must be signed in to star a gist
Format simple table in excel.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub simpleTblFormat() | |
With Selection.Borders(xlEdgeTop) | |
.LineStyle = xlContinuous | |
.Weight = xlThin | |
.Color = rgbBlack | |
End With | |
With Selection.Borders(xlEdgeBottom) | |
.LineStyle = xlContinuous | |
.Weight = xlThin | |
.Color = rgbBlack | |
End With | |
With Selection.Borders(xlEdgeLeft) | |
.LineStyle = xlContinuous | |
.Weight = xlThin | |
.Color = rgbBlack | |
End With | |
With Selection.Borders(xlEdgeRight) | |
.LineStyle = xlContinuous | |
.Weight = xlThin | |
.Color = rgbBlack | |
End With | |
With Selection.Borders(xlInsideVertical) | |
.LineStyle = xlContinuous | |
.Weight = xlHairline | |
.Color = rgbBlack | |
End With | |
With Selection.Borders(xlInsideHorizontal) | |
.LineStyle = xlContinuous | |
.Weight = xlHairline | |
.Color = rgbBlack | |
End With | |
'Format the header row. | |
Selection.Resize(1, Selection.Columns.Count).Select | |
With Selection.Borders(xlEdgeBottom) | |
.LineStyle = xlContinuous | |
.Weight = xlThin | |
.Color = rgbBlack | |
End With | |
With Selection | |
.Interior.Color = RGB(217, 217, 217) | |
.Font.Bold = True | |
End With | |
Selection.Resize(1, 1).Select | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment