Hi All,
I have this code which I wrote to import data from one Excel workbook to another. It works for some amd for most it comes up with error 9, out of subscripts range. Please, I urgently need your help to fix this. Here is the code:
[VBA]Sub ImportDataintoExcelTemplate()
Dim SourceBook As Workbook, NewBook As Workbook
Dim rnStart As Range, rnData As Range
Dim i As Long
Dim T As Boolean
Set SourceBook = ThisWorkbook
T = Application.Dialogs(xlDialogOpen).Show("*.xls")
If T = False Then Exit Sub
Set NewBook = ActiveWorkbook
With NewBook.Sheets("Sheet1")
.Range(.Range("A1:Z6000"), .Cells("65536").End (xlUp)).Copy
End With
Application.ScreenUpdating = True
With SourceBook.Sheets("Sheet1")
.Activate
.Range("A1:Z6000").Activate
.Paste
End With
Application.CutCopyMode = False
NewBook.Close SaveChanges:=False
End Sub[/VBA]
Aussiebear: Edited to place code within the tags
Thanks
Lucpian