Hi,
AM having an error "subscript out of Range (Run time error 9)" in this macro
Sub ss()
FileToOpen = Application.GetOpenFilename _
(Title:="Please Choose the RTCM File", _
FileFilter:="Excel Files *.xls (*.xls),")
If FileToOpen = False Then
MsgBox "No file specified.", vbExclamation, "Duh!!!" ' Notification that nothing is chosen
Exit Sub
Else ' Load the file, copy the first sheet and paste it in active sheet ...
ThisWorkbook.Activate
ThisWorkbook.ActiveSheet.Range("A1:Z65536").ClearContents
Workbooks(FileToOpen).Activate
lrow = Workbooks(FileToOpen).Sheets("Sheet1").Cells(65536, 1).End(xlUp).Row
Workbooks(FileToOpen).Sheets("Sheet1").Range("A1:Z" & lrow).Copy
ThisWorkbook.Activate
ThisWorkbook.ActiveSheet.Range("A1").PasteSpecial xlPasteValues
End If
End Sub
I highlighted a line, where i get this error.
Please help
Thanks
Bookmarks