That code finds the last row depending on the values in column A. That was chosen arbitrarily because it is quite often the key field on a data sheet.
However, if the bottom rows are hidden, they will be ignored, so the results could be misleading.
If the last row is visible, it doesn't matter how many intermediate rows are hidden.
If you filtered and removed some rows and either turned the filter off or the last row was visible, you'd need to run that line of code again to refresh the value.
Maybe you should experiment to see what you get.
Use
in the Immediate Window to quickly check the effects of filtering, particularly if the last row(s) are hidden.
Regards, TMS
Regards, TMS
Bookmarks