Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Anyone have any idea why this won't work? All I am trying to do is copy the
contents on an entire worksheet from one workbook, and paste over the contents of a sheet called "Data" in another workbook. Set bk = Workbooks.Open(myFileName) bk.Worksheets(1).Cells.Copy ThisWorkbook.Worksheets("Data").Cells.Paste bk.Close savechanges:=False |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Paste is not a range method, but a worksheet method.
Set bk = Workbooks.Open(myFileName) bk.Worksheets(1).Cells.Copy _ ThisWorkbook.Worksheets("Data").Cells bk.Close savechanges:=False Should work. HTH, Bernie MS Excel MVP "Steph" wrote in message ... Anyone have any idea why this won't work? All I am trying to do is copy the contents on an entire worksheet from one workbook, and paste over the contents of a sheet called "Data" in another workbook. Set bk = Workbooks.Open(myFileName) bk.Worksheets(1).Cells.Copy ThisWorkbook.Worksheets("Data").Cells.Paste bk.Close savechanges:=False |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You can also use
Set bk = Workbooks.Open(myFileName) bk.Worksheets(1).Cells.Copy ThisWorkbook.Worksheets("Data").Cells.PasteSpecial xlPasteAll bk.Close savechanges:=False -- Regards, Tom Ogilvy "Steph" wrote in message ... Anyone have any idea why this won't work? All I am trying to do is copy the contents on an entire worksheet from one workbook, and paste over the contents of a sheet called "Data" in another workbook. Set bk = Workbooks.Open(myFileName) bk.Worksheets(1).Cells.Copy ThisWorkbook.Worksheets("Data").Cells.Paste bk.Close savechanges:=False |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Simple Paste Issue | Excel Programming | |||
Simple Copy and Paste | Excel Programming | |||
Real simple VBA not sure why I cannot paste. | Excel Programming | |||
Simple Copy & Paste | Excel Programming | |||
Simple copy and paste | Excel Programming |