ExcelHobbit
New Member
- Joined
- Jan 8, 2020
- Messages
- 23
- Office Version
- 2010
- Platform
- Windows
I want to highlight cell b37 and until the last row (which might change) in order to format that range of data
this is what i have so far, whereby i have declared at the very start of the code the following:
Dim Lastrow as Long
originally i had it as range("B37:B150").Select, but i had to change this as the last row will change
this is what i have so far, whereby i have declared at the very start of the code the following:
Dim Lastrow as Long
originally i had it as range("B37:B150").Select, but i had to change this as the last row will change
VBA Code:
Range("B37:B & Rows.Count").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.ColorIndex = xlAutomatic
.TintAndShade = 0
.Weight = xlMedium
End With