camper12
asked on
last row
Hi,
I am using the following to get the last row of a column:
lastRowClass2 = ActiveSheet.Range("D" & Rows.Count).End(xlUp).Row
I want to modify this a bit and find the last row only in a particular range such as D1:D20. I do not want to consider values that are beyond row 20.
How can I do that?
Thanks
I am using the following to get the last row of a column:
lastRowClass2 = ActiveSheet.Range("D" & Rows.Count).End(xlUp).Row
I want to modify this a bit and find the last row only in a particular range such as D1:D20. I do not want to consider values that are beyond row 20.
How can I do that?
Thanks
lastRowClass2 = Range("D1:D20").Row + Range("D1:D20").Rows.Count - 1
But then again it's always 20 isn't it?
ASKER
Sorry, I want to find the first blank and its corresponding row number in range D1:D20
Thanks
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I'm glad I was able to help.
In my profile you'll find links to some articles I've written that may interest you.
Marty - MVP 2009 to 2015
In my profile you'll find links to some articles I've written that may interest you.
Marty - MVP 2009 to 2015