Hello To all,
How are ya?/
I have a slight problem with this code.
Sub mnuFileOpen_Click()
Dim FullFileName As String
FullFileName = Application.GetOpenFilename("Excel Files (*.xls),*.xls", False)
Application.StatusBar = "Opening " & FullFileName
Workbooks.Open FullFileName
Sheets(1).Range("A:H").Copy
Workbooks("Trading Accounts.xls").Activate
Sheets("FMA Data").Select
Range("A1").Select
Selection.PasteSpecial xlValues
'Workbooks("Trading Accounts.xls").Sheets("FMA Data").Range("A1").PasteSpecial xlValues
Workbooks(FullFileName).Activate
Application.CutCopyMode = False
Application.StatusBar = "Closing " & FullFileName
ActiveWindow.Close
Application.StatusBar = False
End Sub
When I get to "Workbooks(FullFileName).Activate", i get the error
Runtime Error 9 - Subscript out of range.
I have checked help files but I have no clue what it is saying since I am new to Vba.
Thanks
How are ya?/
I have a slight problem with this code.
Sub mnuFileOpen_Click()
Dim FullFileName As String
FullFileName = Application.GetOpenFilename("Excel Files (*.xls),*.xls", False)
Application.StatusBar = "Opening " & FullFileName
Workbooks.Open FullFileName
Sheets(1).Range("A:H").Copy
Workbooks("Trading Accounts.xls").Activate
Sheets("FMA Data").Select
Range("A1").Select
Selection.PasteSpecial xlValues
'Workbooks("Trading Accounts.xls").Sheets("FMA Data").Range("A1").PasteSpecial xlValues
Workbooks(FullFileName).Activate
Application.CutCopyMode = False
Application.StatusBar = "Closing " & FullFileName
ActiveWindow.Close
Application.StatusBar = False
End Sub
When I get to "Workbooks(FullFileName).Activate", i get the error
Runtime Error 9 - Subscript out of range.
I have checked help files but I have no clue what it is saying since I am new to Vba.
Thanks