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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

URGENT HELP NEEDED COPYING EXCEL SHEET FROM ONE BOOK TO ANOTHER

Status
Not open for further replies.

JrClown

Technical User
Oct 18, 2000
393
US

I need help in copying one Excel worksheet from book1 to book2

"The reward of one duty done is the power to fulfill another"
<%
Jr_Clown@Yahoo.com
%>
 
If you have a specific problem, please provide a little more information.

In general, to copy say Sheet1 to Book2 you can use something like
Code:
Workbooks(&quot;Book1.xls&quot;).Sheets(&quot;Sheet1&quot;).Copy _
        Before:=Workbooks(&quot;Book2.xls&quot;).Sheets(1)
The VBA help gives some info and examples about variations on this theme.

Best regards,

ilses



 
Yes, but do add

Sub NameOfYourMacro()
'code
End Sub

and put it in a module associated with the correct workbook.

To quickly get the hang of it, start the macro recorder and record the steps in Excel that you wish to automate. The reorded code will have a lot of superfluous gibberish in it, but gives helpful clues about objects, methods etc.

HTH

ilses
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top