billandrew
Well-known Member
- Joined
- Mar 9, 2014
- Messages
- 743
Good afternoon
Could someone provide an explanation why the below endrow variable is not locating the last row of data in it's current position in the script. It stops format before the last row. This maybe an easy one, I am unable to see it.
Could someone provide an explanation why the below endrow variable is not locating the last row of data in it's current position in the script. It stops format before the last row. This maybe an easy one, I am unable to see it.
Code:
Sub FormatRange()
Dim endrow As Long
endrow = Range("H" & Rows.Count).End(xlUp).Row
Application.ScreenUpdating = False
Sheets("Sheet1").Activate
With Range("I1:M4")
.VerticalAlignment = xlBottom
.WrapText = True
.HorizontalAlignment = xlCenter
End With
Cells(1, 1).Font.Size = 42
Cells(1, 1).Font.Bold = True
With Range("A2", Range("M" & Rows.Count).End(xlUp))
.Font.Size = 30
.Font.Name = "Calibri"
End With
Range(Cells(6, 1), Cells(6, 13)).Font.Size = 28
With Range("I7", Range("I" & endrow))
.NumberFormat = "#,##0.00"
.Font.Size = 30
End With
Last edited: