Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

copying & pasting 2

Status
Not open for further replies.

kgs51

Computer
Nov 28, 2003
2
I would like to know the vba code to copy the contents of one worksheet to the next available empty cells of another worksheet. These worksheets are all in one workbook.
 
Replies continue below

Recommended for you

Hello,

DO you mean you wish to copy an entire sheet to the next worksheet that is currently empty?

i.e. If you have five sheets, Sheets 1, 2 and 3 all have some data and you wish to copy Sheet 1 to SHeet 4? or do you mean something different?





Hope this helps.

----------------------------------

maybe only a drafter
but the best user at this company!
 
I have certain cells of one worksheet that I want to paste to certain cells of another worksheet. The one worsheet which I am taking a copy of changes. So when I paste again I want to be able to go to the next empty set of cells.

Thanks

Ken
 
You can use Worksheet("target").UsedRange to retrieve the used range on the target sheet (replace "target" with the sheet name). If you then use the offset method to go one row lower, you will be able to paste to the next lower row.

Cheers,
Joerd

Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.
 
I have found the easiest way to do anyhting like this is to record a macro whilst manually performing the operation you require. Then look at the code produced, and edit where necessary.

Usually, the resultant VBA is a bit over-the-top. It will contain a whole load of stuff that is actually not required. But you can remove this manually to get more compact code. Comment it out first, make sure it still works correctly, then delete it.
 
That's my preferred method of creating macros, too, tomatge.
Thanks for sharing.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor