Hi,
I am using the below VBA Code to filter some specific column (Source file- Active Workbook) and paste in new work book
I need to do this activity for many files. can someone help to modify the code as below.
I need to select multiple files instead of active workbook, then one be one all files to be copied and pasted in new work book.
Example if i select 5 excel files, (All in same folder only) first excel file to be copied and pasted in new workbook (as per sample vba code) and then the new workbook to be saved as main file.
then the second excel file (out of 5) to be copied and pasted in last row of main file.
Currently i am opening one by one and running the macro. Macro is working fine, however instead opening one by one and running the code, i am seeking some one help to modify the code instead of active workbook to selection of excel files.
Kindly help to modify the above code.
Sub Dates()
Dim wb As Workbook: Set wb = ActiveWorkbook
Dim a: a = ActiveSheet.Range(Cells(6, 1), Cells(6, ActiveSheet.UsedRange.Columns.Count))
With ActiveSheet.Range("C1:C" & ActiveSheet.UsedRange.Rows.Count)
.Value = Evaluate(Replace("if(isnumber(@),@)", "@", .Address))
.Parent.UsedRange.AutoFilter 3, "<>False"
.Parent.UsedRange.SpecialCells(12).Copy
End With
Workbooks.Add
[A1].PasteSpecial xlPasteAll
[A1].Resize(, UBound(a, 2)) = a
Application.DisplayAlerts = False
wb.Close False
Application.DisplayAlerts = True
End Sub
Bookmarks