I can anyone help me, I am looking for a Macro that will open up files from My Documents and copy and paste on of the Sheets (Master) into a file I need this to happen for 5 files but when they are being copied to the new file I need then to be pated in the next available row where the previous data finished.
I have got some VBA from a previous worksheet and I am trying to adapted it but not having much success
I can get it to copy the first file over but cannot get it to close it so i can nove onto the next file also not to sur how to find the next clear row so it can be pasted into
Any help would be great
Thanks Tom90
[drc = Range("D" & Application.Rows.Count).End(xlUp).Row]
[For i = 1 To drc]
[wb_pth = Cells(i, 4).Value]
[Workbooks.Open (wb_pth)]
[wb = ActiveWorkbook.Name]
[Windows(wb).Activate]
[Sheets("Master").Select
If ActiveSheet.AutoFilterMode = True Then ActiveSheet.AutoFilterMode = False
Columns("A:AT").Hidden = False
Range("A2:AP30000").Copy
Windows("WorkStack Exchange Drop B.xlsm").Activate
Sheets("Data Drop").Select
If ActiveSheet.AutoFilterMode = True Then ActiveSheet.AutoFilterMode = False
Columns("A:AT").Hidden = False
Range("A2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False]
[Range("A1").Select
Sheets("Exchange").Select
ActiveWorkbook.Save]
[Workbooks.Open (wb_pth)
Sheets("Sheet1").Select
ActiveWorkbook.Save
ActiveWindow.Close]
Next i
I have got some VBA from a previous worksheet and I am trying to adapted it but not having much success
I can get it to copy the first file over but cannot get it to close it so i can nove onto the next file also not to sur how to find the next clear row so it can be pasted into
Any help would be great
Thanks Tom90
[drc = Range("D" & Application.Rows.Count).End(xlUp).Row]
[For i = 1 To drc]
[wb_pth = Cells(i, 4).Value]
[Workbooks.Open (wb_pth)]
[wb = ActiveWorkbook.Name]
[Windows(wb).Activate]
[Sheets("Master").Select
If ActiveSheet.AutoFilterMode = True Then ActiveSheet.AutoFilterMode = False
Columns("A:AT").Hidden = False
Range("A2:AP30000").Copy
Windows("WorkStack Exchange Drop B.xlsm").Activate
Sheets("Data Drop").Select
If ActiveSheet.AutoFilterMode = True Then ActiveSheet.AutoFilterMode = False
Columns("A:AT").Hidden = False
Range("A2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False]
[Range("A1").Select
Sheets("Exchange").Select
ActiveWorkbook.Save]
[Workbooks.Open (wb_pth)
Sheets("Sheet1").Select
ActiveWorkbook.Save
ActiveWindow.Close]
Next i