M
mark
Years ago, someone here recommended that I use this to find the intersection
of the last used row and column, independant of whether data had been deleted
since the last save, etc:
reallastrow = Cells.Find("*", Range("A1"), xlFormulas, , xlByRows,
xlPrevious).Row
reallastcol = Cells.Find("*", Range("A1"), xlFormulas, , xlByColumns,
xlPrevious).Column
I've just discovered that the reallastcol part doesn't work if an AutoFilter
is turned on.
Instead of the last used column in the worksheet, it reports the last used
column in the autofilter, ignoring the fact that columns may be used to the
right of the autofilter.
Suggestions?
of the last used row and column, independant of whether data had been deleted
since the last save, etc:
reallastrow = Cells.Find("*", Range("A1"), xlFormulas, , xlByRows,
xlPrevious).Row
reallastcol = Cells.Find("*", Range("A1"), xlFormulas, , xlByColumns,
xlPrevious).Column
I've just discovered that the reallastcol part doesn't work if an AutoFilter
is turned on.
Instead of the last used column in the worksheet, it reports the last used
column in the autofilter, ignoring the fact that columns may be used to the
right of the autofilter.
Suggestions?