zakasnak
Active Member
- Joined
- Sep 21, 2005
- Messages
- 308
- Office Version
- 365
- 2019
- Platform
- Windows
- MacOS
Hi all,
I found this code & it works, but I need to alter it so that only the top, bottom, and internal horizontal are bordered (no internal verticals). My range is Col A-F, variable number of rows, do not border the header row A1:F1.
Help?
I found this code & it works, but I need to alter it so that only the top, bottom, and internal horizontal are bordered (no internal verticals). My range is Col A-F, variable number of rows, do not border the header row A1:F1.
Help?
Code:
Sub TheWall()
Application.ScreenUpdating = False
Dim lngLstCol As Long, lngLstRow As Long
lngLstRow = ActiveSheet.UsedRange.Rows.Count
lngLstCol = ActiveSheet.UsedRange.Columns.Count
For Each rngCell In Range("A2:A" & lngLstRow)
If rngCell.Value > "" Then
r = rngCell.Row
c = rngCell.Column
Range(Cells(r, c), Cells(r, lngLstCol)).Select
With Selection.Borders
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End If
Next
Application.ScreenUpdating = True
End Sub