control end in a macro

B

Belinda7237

I am creating a macro that will filter all of the rows of data in sheet 2
that have an x in a column, copy them, and insert them at the bottom of the
data set in sheet 1 - basically the first available blank row.
My problem is that when recording the macro when i go to sheet 1 to paste i
am using the control end key to find the last record and it is bringing me to
row 65000 when i only have 5000 rows of actual data.
Is there another way besides control end to get to the bottom of the data?
thanks!
 
J

JP

Have you tried

Range("A" & UsedRange.Rows.Count).Offset(1,0)

Also it sounds like the "dirty area" of your worksheet is far beyond
the actual used range. You might want to fix that.

--JP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top