Originally Posted by
Rick Rothstein
I am not so sure of that. My understanding of the original question is that H1 contains a header and H2 contains a formula and the rest of Column H is empty and that jardenp wants to "copy down" the formula in H2 down to the bottom of his data and that he was using Column A to establish where that bottom of data was. His original problem, as I saw it, was that Column A's data was not contiguous and that the empty cells were interferring with the method he had chosen to figure out where the bottom of data in Column A was, so I gave him an alternative method of calculating where the last filled cell in Column A was. I will admit, though, that I do not fully understand the latest problem he is trying to describe to us.
Rick, you are correct that H:H will be empty. However, my problem isn't non-contiguous data in A:A, it's that sometimes I only have the header row or the header row and one data row. All data, if it's there, will be contiguous.
The problem seems to be that whether it's
Code:
Range(H2:H" & Range("A2").End(xlDown).Row
or
Code:
"H2:H" & Cells(Rows.Count, "A").End(xlUp).Row
It fails when there are no rows in A:A beyond row 2, the row in the original range selection (i.e., the "H2:H" part). Since the data I'll be using this code on may have 25 or 0 data rows, I'm wondering if there is an easy way to include all possibilities. Thanks for your help on this.
Bookmarks