Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm using the code below to pull multiple sheets together then move the files
to old folder. Say I want to run the sames files I ran through the macro eariler it won't work if its already located in the old file folder. Please let me know if you need more info to answer this question. Thanks Application.EnableEvents = False Application.ScreenUpdating = False Dim fso Set fso = CreateObject("Scripting.FileSystemObject") PathOld = "R:\Reports\PDP-Reporting\CUSTOMER_SERVICE\DAILY\Scorecard\DATA_FE ED\CURRENT_STREAM_WellCare_PDP\OLD FILES\" 'Change as needed Path = "R:\Reports\PDP-Reporting\CUSTOMER_SERVICE\DAILY\Scorecard\DATA_FE ED\CURRENT_STREAM_WellCare_PDP" ''Change as needed FileName = Dir(Path & "\WellcarePDP_Interval*.csv", vbNormal) Do Until FileName = "" Set Wkb = Workbooks.Open(FileName:=Path & "\" & FileName) For Each WS In Wkb.Worksheets If Left(WS.Name, 20) = "WellcarePDP_Interval" Then WS.Copy After:=ThisWorkbook.Sheets(ThisWorkbook.Sheets.Cou nt) End If Next WS Wkb.Close False fso.MoveFile Path & "\" & FileName, PathOld FileName = Dir() Loop Application.EnableEvents = True Application.ScreenUpdating = True |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Unable to save XLSX files without using 'Save As' and different na | Setting up and Configuration of Excel | |||
Where does Save As Automatic Backup save its files? | Excel Discussion (Misc queries) | |||
Can I save excel files as web connected files | Excel Discussion (Misc queries) | |||
Macro to open *.dat files and save as .txt (comma delimited text files) | Excel Programming | |||
copy subfolders, replace text in files and save files in copied subfolders | Excel Programming |