VBA Snippets


Sel_BorderInsideAdd

Adds borders to the inside of all the highlighted cells.
Public Sub Sel_BordersInsideAdd( _
ByVal sColourKey As String)

Const sPROCNAME As String = "Sel_BordersInsideAdd"

On Error GoTo ErrorHandler

Selection.Borders.InsideLineStyle = Options.DefaultBorderLineStyle
Options.DefaultBorderColorIndex = Return_ShadingColour(sColourKey)

If gbDEBUG = False Then Exit Sub
ErrorHandler:
' Call Error_Handle(msMODULENAME, sPROCNAME, 1,
Call MsgBox( _
"add borders to the inside of all the highlighted cells")
End Sub

Sel_BorderInsideRemove

Removes all the borders from the inside of all the selected cells.
Public Sub Sel_BorderInsideRemove()

Const sPROCNAME As String = "Sel_BorderInsideRemove"

On Error GoTo ErrorHandler


If gbDEBUG = False Then Exit Sub
ErrorHandler:
' Call Error_Handle(msMODULENAME, sPROCNAME, 1,
Call MsgBox( _
"remove the border from the inside of the highlighted cells")
End Sub

© 2025 Better Solutions Limited. All Rights Reserved. © 2025 Better Solutions Limited Top