Hi all
I have work book Total.xlsm with sheets(Main, A001, B002, C003, D004,E005,F006)
Total.xlsm is the same path with alot of folders: 202006,202005,202004,202003,......201912,20201911,201910,...etc (Folder have name like yyyymm)
Now I want to have macro to do this:
1. Check each Folder name with range("A2: lastrow)
2. If meet folder.name will check 4 characters of each excel name with: Left(excel_filename,4) = Range("B2:lastrow")
3. If Filename exist will copy data to Total.xlsm like:
Left(excel_filename,4) = "A001" then copy data to workbook("total").sheets("A001").Range("A1")
Left(excel_filename,4) = "B002" then copy data to workbook("total").sheets("B002").Range("A1")
Left(excel_filename,4) = "C003" then copy data to workbook("total").sheets("C003").Range("A1")
Left(excel_filename,4) = "D004" then copy data to workbook("total").sheets("D004").Range("A1")
Left(excel_filename,4) = "E005" then copy data to workbook("total").sheets("E005").Range("A1")
Left(excel_filename,4) = "F006" then copy data to workbook("total").sheets("F006").Range("A1")
Please help me./.
Bookmarks