Hi,
I am just trying my hand with this macro. The purpose of this macro is to
colour code the content of every alternate cell in the selected range to Blue
(which is happening) and border it with a blue dotted box (which is not
happening). I have written this code but it does not seem to work correctly.
The macro should actually put a border around the cells in the selected
range. However, it borders the active cell in the range and in the other
alternate cell it just puts a border on three sides.
Any help would be highly appreciated
Sub Dotted_box()
For Each c In ActiveCell.CurrentRegion.Cells
If c.Column Mod 2 <> 0 Then
ActiveCell.Font.ColorIndex = 5
With ActiveCell.BorderAround(xlContinuous, xlHairline, 5)
End With
End If
Next c
Selection.Font.ColorIndex = 5
With Selection.BorderAround(xlContinuous, xlHairline, 5)
End With
End Sub
Regards,
Bookmarks