Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Save over files.

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to save XLSX files without using 'Save As' and different na SlackerBoy Setting up and Configuration of Excel 1 March 14th 09 09:14 PM
Where does Save As Automatic Backup save its files? JoAnn Excel Discussion (Misc queries) 3 April 4th 08 08:48 PM
Can I save excel files as web connected files Sophia Chen Excel Discussion (Misc queries) 0 September 27th 06 11:34 PM
Macro to open *.dat files and save as .txt (comma delimited text files) [email protected] Excel Programming 2 November 30th 05 05:50 AM
copy subfolders, replace text in files and save files in copied subfolders pieros Excel Programming 0 November 1st 05 12:08 PM


All times are GMT +1. The time now is 03:26 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"