jamiwr
07-31-2008, 09:36 AM
I am looking to create a macro to do the following while on the active sheet of the active workbook:
1. Open file to select a workbook
2. Copy all in new workbook
3. Paste all from new workbook into original workbook at bottom of row
4. Close new workbook
5. Do it again which can vary for the amount of times
This is what I have so far and the text file name will always be the same but for the purpose of the upload I had to make them different. I would like this to be dynamic:
Dim strfile As String
Dim wkb1 As Workbook
Dim wkb2 As Workbook
Set wkb1 = ActiveWorkbook
strfile = Application.GetOpenFilename
If strfile = "False" Then Exit Sub
Workbooks.Open strfile
'This is where I get an error message
Range("A1", Range("A65536").End(xlUp)).Copy Destination:=wkb1.Sheets("Feb 08").Range("A1").End(xlDown).Offset(1, 0)
End Sub
1. Open file to select a workbook
2. Copy all in new workbook
3. Paste all from new workbook into original workbook at bottom of row
4. Close new workbook
5. Do it again which can vary for the amount of times
This is what I have so far and the text file name will always be the same but for the purpose of the upload I had to make them different. I would like this to be dynamic:
Dim strfile As String
Dim wkb1 As Workbook
Dim wkb2 As Workbook
Set wkb1 = ActiveWorkbook
strfile = Application.GetOpenFilename
If strfile = "False" Then Exit Sub
Workbooks.Open strfile
'This is where I get an error message
Range("A1", Range("A65536").End(xlUp)).Copy Destination:=wkb1.Sheets("Feb 08").Range("A1").End(xlDown).Offset(1, 0)
End Sub