Fig 1

Get the spreadsheet used in the tutorial above.
Also receive updates on when new blog or video tutorials are released.
01 Sub FormatLastRow() 02 Dim rngHeader As Range, rngdata As Range, rngLastRow As Range 03 04 ' Substitute the actual worksheet name for "Register" 05 Set rngData = ThisWorkBook.Worksheets("REGISTER").Range("A4").CurrentRegion 06 07 ' Line above gets reference to all of the data 08 Set rngHeader = rngData.Resize(1) ' Get reference to header row. 09 10 ' Offset the header reference by the number of rows in the data, less one row to get reference to last row. 11 Set rngLastRow = rngData.Resize(1).Offset(rngData.Rows.Count - 1) 10 For Each rngCell In rngLastRow 11 ' rngCell iterates over each cell in this last row, 12 ' substitute your own code for line 14 or download 13 ' spreadsheet with code to get other ideas. 14 rngCell.select 15 Next 16 17 ' Clean up object variables 18 Set rngData = Nothing: Set ringleader = Nothing: Set rngLastRow = Nothing 19 End Sub
If you found this article really helpful, then consider grabbing me a coffee, it takes a lot of work and expense to keep this site going, the more caffeine I have the harder I can work.
And if you do grab me a coffee, thanks for your support 😉
Hi Sean,
I liked u r approach while writing VBA codes u approach is unique and prevents unnecessary coding.
I having been writing VBA codes since last 7 years and visited many sites and viewed many vedios on YouTube but I think your method is the best.
Thank you,
Neelesh