Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default count / move files


Hi,
win XP Excel 2003 + win 2000 Excel 97

I'd like to achieve
1 - check/count files in location 2 based on date (older then today or files
from today)
2 - check/count files in location 3 warn if older then X days based on
todays date
3 - move files from location 2 to location 4 if older then today or files
from todays after the count in step 1
4 - It would be great if the files that are moved to location 4 could create
a folder for the respective month. So, if the file was saved on July 20 2005,
i'd like to have it moved to folder \2005 July\. If that folder does not yet
exist, create the folder. File names remain the same and dont need to change.

Thank you for your help.
Stefan
______________________________

And this where i am now:
Private Sub search()
Dim i As Long
Dim FS As FileSearch
Set FS = Application.FileSearch
Dim Msg, Style, Title, Response, MyString
Msg = "Do you want to run the process now." & (Chr(10))
Style = vbYesNo + vbDefaultButton1
Title = "Process Service Forms Now"
Response = MsgBox(Msg, Style, Title)
If Response = vbYes Then
MyString = "Yes"
'Range("B2:B4").Clear
' ______________________
' Count Not Processed
MsgBox "Counting Not Processed Files"
With FS
.LookIn = "location1\"
'.FileName = "*.xls"
If .Execute(SortBy:=msoSortByFileName, _
SortOrder:=msoSortOrderAscending) 0 Then
Range("B2") = FS.FoundFiles.Count
End If
End With
' ______________________
' Count Pending
MsgBox "Counting Pending Files"
With FS
.LookIn = "location2\"
'.FileName = "*.xls"
If .Execute(SortBy:=msoSortByFileName, _
SortOrder:=msoSortOrderAscending) 0 Then
Range("B3") = FS.FoundFiles.Count
End If
End With
' ______________________
' Count Completed
MsgBox "Counting Completed Files"
With FS
.LookIn = "location3\"
'.FileName = "*.xls"
If .Execute(SortBy:=msoSortByFileName, _
SortOrder:=msoSortOrderAscending) 0 Then
Range("B4") = FS.FoundFiles.Count
End If
End With
' ______________________
' Move / Archive files older then day X (depending on when the count report
is run
' would be last business day (older then today) or today's files
MsgBox "Archiving Files"
' location4
' ______________________
MsgBox "Process Completed"
Else
End If
MsgBox "Process Stopped"
End Sub


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200507/1
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
USE DRAG AND DROP TO MOVE FILES tyco Excel Discussion (Misc queries) 1 October 28th 07 10:08 AM
Move all files from one directory to another Prema Excel Programming 5 July 15th 05 12:09 AM
move all files in a directory into another [email protected] Excel Programming 1 January 24th 05 02:53 PM
Move files from one directory to another: if they are there Michael McClellan Excel Programming 12 June 28th 04 12:42 AM
How to move files from the code Ana Excel Programming 3 May 17th 04 03:03 PM


All times are GMT +1. The time now is 04:41 PM.

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

About Us

"It's about Microsoft Excel"