duncan1970
New Member
- Joined
- Jun 25, 2011
- Messages
- 3
Sub CompareSingle1()
Application.ScreenUpdating = False
Dim csvdir As String
Dim xlsxdir As String
Dim windir As String
ChDir "C:\Users\EricB\Desktop"
Workbooks.Open Filename:="C:\Users\EricB\Desktop\Singlecopy.xlsx"
xlsxdir = "C:\Users\EricB\Desktop\Single2\jun17"
ChDir xlsxdir
For i = 1 To 15000
Workbooks.Open Filename:=xlsxdir & "\jun17_" & i & ".xlsx"
Range("G1").Select
Selection.Copy
Windows("singlecopy").Activate
Range("A1").Select
Cells(Rows.Count, "b").End(xlUp).Offset(1, 0).Select
ActiveSheet.Paste
Workbooks(3).Activate
ActiveWorkbook.Close
Next i
End Sub
Application.ScreenUpdating = False
Dim csvdir As String
Dim xlsxdir As String
Dim windir As String
ChDir "C:\Users\EricB\Desktop"
Workbooks.Open Filename:="C:\Users\EricB\Desktop\Singlecopy.xlsx"
xlsxdir = "C:\Users\EricB\Desktop\Single2\jun17"
ChDir xlsxdir
For i = 1 To 15000
Workbooks.Open Filename:=xlsxdir & "\jun17_" & i & ".xlsx"
Range("G1").Select
Selection.Copy
Windows("singlecopy").Activate
Range("A1").Select
Cells(Rows.Count, "b").End(xlUp).Offset(1, 0).Select
ActiveSheet.Paste
Workbooks(3).Activate
ActiveWorkbook.Close
Next i
End Sub