Hi friends,
I want to create inner and outer border macro to avoide repeated job and save time.
I’m getting run-time error 424 object require error.
Option Explicit
Sub Borders()
Dim OB As Variant
OB = InputBox("enter cell number to border around")
Dim IBV As Variant
IBV = InputBox("enter cell number to border inside")
Dim IBH As Variant
IBH = InputBox("enter cell number to border inside")
'Outer border
With OB
.CurrentRegion.BorderAround Color:=-6279056, Weight:=xlThick, LineStyle:=xlSlantDashDot
End With
'Inner border
With IB
.CurrentRegion.Borders (xlInsideVertical)
.LineStyle = xlContinuous
.ColorIndex = xlAutomatic
.Weight = xlThin
End With
With IB
.CurrentRegion.Borders (xlInsideHorizontal)
.LineStyle = xlContinuous
.ColorIndex = xlAutomatic
.Weight = xlThin
End With
MsgBox "Done!", 64
End Sub
Any help will be highly appreciated.
Thanking you in anticipation.
Bookmarks