Link to home
Start Free TrialLog in
Avatar of kbay808
kbay808Flag for United States of America

asked on

How to modify my VBA code to select a range that will stop on the first row that has no data?

The below code works perfect, but the range is fixed.  Instead of range "L2:L2000" I want to make the range "l2: the last row with data".

Range(Sheet3.Range("L2:L2000").Find("No"), Sheet3.Range("L" & Rows.Count).End(xlUp)).EntireRow.Resize(, 10).Copy
Sheet2.Range("A" & Rows.Count).End(xlUp).Offset(1).PasteSpecial xlPasteValues

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of crystal (strive4peace) - Microsoft MVP, Access
crystal (strive4peace) - Microsoft MVP, Access

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kbay808

ASKER

It worked great...  Thank you
Avatar of crystal (strive4peace) - Microsoft MVP, Access
crystal (strive4peace) - Microsoft MVP, Access

you're welcome ~ happy to help