Davers
Well-known Member
- Joined
- Sep 17, 2002
- Messages
- 1,165
I'd like an error handler on my code...i've never created one before so I'm not quite sure how to go about it. The following code copies a folder and renames it in a new directory. I'd like it to check to see if the new folder it is being named to already exists, and if so give you the option to cancel. Here is the code:
The myDest part is where it creates the new folder...
Any ideas?
Thanks,
Dave M.
Code:
Sub copyFDfiles()
Dim myDir As String
Dim myDest As String
Dim fs As New Scripting.FileSystemObject
myDir = Range("C11").Value
myDest = Range("C12").Value
fs.copyfolder myDir, myDest
End Sub
The myDest part is where it creates the new folder...
Any ideas?
Thanks,
Dave M.