Hi,
Am having foler having more than 200 documents having .docx and .rtf formats and now i need to seperate as docx in one folder and .rtf in one folder, please any one help me in this regards...
Hi,
Am having foler having more than 200 documents having .docx and .rtf formats and now i need to seperate as docx in one folder and .rtf in one folder, please any one help me in this regards...
Would this not be easier to user Windows explore?
Open Windows explorer
Create the two directory’s where you want i.e. Document/dir 1 and dir 2
Drill down the directory you want to copy from
Sort by type i.e xls
Select these
Copy
Paste to Dir 1 or 2 as you wish
Delete once copied
Same for txt to other directory
Seconds work and no real need for code
jiuk
You can actually just drag & drop to the other folder. Select the files using whilst holding the Ctrl button down. Drag to the destination folder and choose Move when the menu opens
Thanks for replying currently am doing the same and i expected that it can be automate with a single click.
Everyday in my task i need to work on 500 to 700 files in a folder...
Selecting 500 files and seperating involves much time and efforts if possible it can be automate. so am looking for that....
Any how thanks for replying...
This is not an Excel question. Search the web for free file moving software
Hi,
Thanks for replying and inspiring me ....
With your words i had found code that it is in excel only....
Please check below.....
Please dont say directly it is not related to excel ...
Anyhow thanks i get the code....
Sub Copy_Certain_Files_In_Folder()
'This example copy all Excel files from FromPath to ToPath.
'Note: If the files in ToPath already exist it will overwrite
'existing files in this folder
Dim FSO As Object
Dim FromPath As String
Dim ToPath As String
Dim FileExt As String
FromPath = "C:\Users\Ron\Data" '<< Change
ToPath = "C:\Users\Ron\Test" '<< Change
FileExt = "*.docx*" '<< Change
'You can use *.* for all files or *.doc for Word files
If Right(FromPath, 1) <> "\" Then
FromPath = FromPath & "\"
End If<img src="https://www.ozgrid.com/forum/core/images/smilies/emojione/1f44d.png" alt=":thumbup:" class="smiley" srcset="https://www.ozgrid.com/forum/core/images/smilies/emojione/[email protected] 2x" height="23" data-tooltip="thumbup" id="wscSmiley_0_0">
Set FSO = CreateObject("scripting.filesystemobject")
If FSO.FolderExists(FromPath) = False Then
MsgBox FromPath & " doesn't exist"
Exit Sub
End If
If FSO.FolderExists(ToPath) = False Then
MsgBox ToPath & " doesn't exist"
Exit Sub
End If
FSO.CopyFile Source:=FromPath & FileExt, Destination:=ToPath
MsgBox "You can find the files from " & FromPath & " in " & ToPath
End Sub
Display More
Don’t have an account yet? Register yourself now and be a part of our community!