Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
I am trying to run the below code to import the contents of a sheet from an external wb to the current workbook but it is coming up with the error 'Subscript out of range' on line Workbooks(CurWkBk).Worksheets("ZPODetails").Range( "a1").Paste Can anyone help me fix this and also give me a reason why this error fires? TIA Sub Import_ZPODetails() Dim FName As String Dim WkBk As Workbook Dim CurWkBk As String CurWkBk = ActiveWorkbook.Name FName = Application.GetOpenFilename() If FName < "False" Then Set WkBk = Workbooks.Open(FName) WkBk.Worksheets(1).Cells.Copy Workbooks(CurWkBk).Worksheets("ZPODetails").Range( "a1").Paste WkBk.Close SaveChanges:=False End If End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
9: Subscript out of range | Excel Discussion (Misc queries) | |||
Subscript out of Range | Excel Programming | |||
Subscript is out of Range | Excel Programming | |||
Subscript out of Range Q | Excel Programming | |||
Subscript Out of Range | Excel Programming |