Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am trying to do the following using VBA:
1. Open a workbook 2. Copy a sheet 3. Paste it on a destination WorkBook.Sheet where this sheet it hidden 4. Close the source workbook I tried the following: Sub Copyfromworkbook() Dim SourceWkbk As Workbook Set SourceWkbk = Workbooks.Open(Filename:="Book2.xls") SourceWkbk.Sheets("Sheet3").Copy ' ActiveSheet.Paste Destination:=Sheets("Sheet4").Range("A1") Sheets("Sheet4").Range("A1").Select ActiveSheet.Paste SourceWkbk.Close savechanges:=False End Sub I get a subscript out of range error. Can you please tell me where I am going wrong. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Worksheet formula incorrect after copying to another worksheet | Excel Worksheet Functions | |||
Copying worksheet cells into another worksheet using autofill | Excel Discussion (Misc queries) | |||
Looking up a variable in one worksheet and copying information from another column to another worksheet?? | Excel Discussion (Misc queries) | |||
Copying a worksheet witrh protected cells to a new worksheet | Excel Worksheet Functions | |||
Copying Worksheet triggers Click event of combobox on another worksheet | Excel Programming |