what is wrong with this code?

N

Nicole Seibert

Hi,

This doesn't work:
'*** NOTICE: This does not include the header row as we are adding on to the
bottom of
'what is already on BA Approved
Dim lastcell1 As Integer
lastcell1 = Range("A1").End(xlDown).Count
Range("A3:R(lastcell1)").Select
Range("R(lastcell1)").Activate
Selection.Copy
Sheets("Estimated - BA Approved").Select
'
'Find the first cell in column A WITHOUT Data and start paste in this cell
Range("A1").End(xlDown).Offset(1, 0).Select
ActiveSheet.Paste

Can you tell me why? And can you tell me if there is an easier way to
select used rows only up until the two row header?
Thank you,
Nicole
 
T

Tom Ogilvy

set rng = cells(rows.count,1).end(xlup)(2)

will give you the blank cell at the bottom of the data as determined by
column 1.

If you do that, you are not concerned with header rows as even if there are
only header rows, it would be below those.
 
N

Nicole Seibert

Thank you to both of you for both of your responses on both my posts.
-Nicole
 

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

Similar Threads

help with code 2
VBA Coding Help for Beginner 0
Saving a range for later reference 0
Help me5 1
End(xlDown) Issue 1
Need Help with a VBA subroutine 0
Copy columns and paste with blank column between 5
Macro Loop 0

Top