I write my macro like this...
Private Sub CommandButton1_Click()
Filename = Application.GetOpenFilename
Workbooks.Open Filename:=Filename
Windows(Filename).Activate
Range("A1").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Windows("Rofin Pareto1.xls").Activate
Sheets("Raw Data").Range("A1").Select
ActiveSheet.Paste
End Sub
but when come to :Windows(Filename).Activate"..it will pop out to debug wit error..."Subcript out of range"...any1 can help me...urgent!
it also not work with the filename without space....i did not open the file also during run...any idea?
Bookmarks