I\'m new here and I\'m looking to use Excel VBA to return the last used cell in a worksheet.
I\'vv looked at Error in finding last used cell in Excel with VBA) but that d
Although the answers are very valid, I'd be careful using SpecialCells, CurrentRegion and all those.
Although they work most of the time, they are not 100% reliable in my experience.
For example, CurrentRegion will not pick up all data if the data happens to have an empty column or row etc.
The best Approach, in my opinion is to always use headers with your data. You can then enumerate all headers and find the last used row in that column. You can then determine the greatest row used and now define your data range.
Btw, if you select the last cell in a specified column then use the Range.End(xlUp) you can quickly determine the last used row for that column without Looping.