Macro for copying sheet1 from work book1 to sheet2 workbook2

ssahmed77

New Member
Joined
Nov 21, 2005
Messages
4
Hi to all
I would like a macro which can copy a sheet(sheet1) from workbook1 while workbook is closed, into sheet2 of workbook2, i need to copy the whole sheet, please help me in this regard I am very thankfull for all of you. :cool:
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Have you tried to record a macro for this problem?

Create a button and put it on sheet2 of workbook2

Sub Copy()

'Open the data download file
Workbooks.Open "C:\Documents and Settings\yourname\Desktop\book1.xls"

'Update information from cells A:VI on the download sheet to the database
Windows("Book1.xls").Activate
Sheets("Sheet1").Select
Columns("A:VI").Select
Selection.Copy
Windows("Book2.xls").Activate
Sheets("Sheet2").Select
Columns("A:VI").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

'Close the download sheet
Windows("Book1.xls").Activate
ActiveWindow.Close

End Sub
 
Upvote 0
Dear 98illini
Thanks for your reply I appreciate it sorry for replying you late
I try to use your code but I have a problem in it and the exact line where I debug it is
Columns("A:VI").Select
as your cide is stuck here its on the basis of debugging result
as I try several option here
Like Range("A2:d")
but it also not working
What do u think
 
Upvote 0

Forum statistics

Threads
1,214,823
Messages
6,121,779
Members
449,049
Latest member
greyangel23

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top