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

asked on

How to copy a range from a worksheet and paste it after the last row on another worksheet using VBA?

I need to copy all rows except for the headers from sheet1 to after the last row of data on sheet2.  There could be up to 100 rows that need to be copied.  I also need to have the date entered in column “E” on sheet2 for each entry copied.  Please see the attached example.
Eample.xlsm
SOLUTION
Avatar of Saqib Husain
Saqib Husain
Flag of Pakistan image

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
ASKER CERTIFIED SOLUTION
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

Works great!!!  Thanks
Did the first comment not work?
GlLad it helped.
Avatar of kbay808

ASKER

@Saqib Husain, Syed:  It does work for the example, but it’s not as robust as Roy’s solution.  As I added more columns of data only Roy’s solution worked.
There isn't any difference between the approach of either solution. Please show me the scenario where one  works and the other does not. I had started with the same one-line solution as Roy's but had to use variables because there was another requirement for the date which I have addressed but missing from the other solution.
Avatar of kbay808

ASKER

@Saqib Husain, Syed:  When I originally tested it, it did not work, but I’m unable to duplicate my results.  Your code is working, but I just noticed that both codes are copying the formulas.  I need it to only copy the values.  I reposted the question if you would like to respond.
You never mentioned not copying formulas. Simply use PasteSpecial values
So, if the code works you should reopen the question
Avatar of kbay808

ASKER

How do you do that?  I don't see an option for that?