Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

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

VBA: copy and insert a worksheet

Status
Not open for further replies.

airtabaki

Technical User
Aug 7, 2003
31
BE
I have a really simple question for programmers I think, I want to insert copies of an existant worksheet in my workbook by using VBA. Can any one help me please with the right fonctions.
 
Hi
The following will copy sheet1 of the book containing the code into book2 as the first sheet.

Code:
Set wb1 = ThisWorkbook
Set wb2 = Workbooks("Book2")

wb1.Worksheets(1).Copy before:=wb2.Sheets(1)

If this isn't precisely what you are after or you can't adapt it would you post back with more detail of what you want to copy from where to where ie where is the sheet you want to copy?

;-)

If a man says something and there are no women there to hear him, is he still wrong? [ponder]
The faqs ma'am, just the faqs. Get the best from these forums : faq222-2244
 
I meant it a bit diffrent, but the code you gave me helped me to find the solution, thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top