coxonitus
04-29-2011, 05:58 AM
hi guys,
who could help me out.
i'm using this code:
copy Macro
Dim FSO As Object
Dim FromPath As String
Dim ToPath As String
FromPath = "C:\project/test"
ToPath = "G:\Project\test\" '<< Change
'If you want to create a backup of your folder every time you run this macro
'you can create a unique folder with a Date/Time stamp.
'ToPath = "C:\Users\Ron\" & Format(Now, "yyyy-mm-dd h-mm-ss")
If Right(FromPath, 1) = "\" Then
FromPath = Left(FromPath, Len(FromPath) - 1)
End If
If Right(ToPath, 1) = "\" Then
ToPath = Left(ToPath, Len(ToPath) - 1)
End If
Set FSO = CreateObject("scripting.filesystemobject")
If FSO.FolderExists(FromPath) = False Then
MsgBox FromPath & " doesn't exist"
Exit Sub
End If
FSO.CopyFolder Source:=FromPath, Destination:=ToPath
MsgBox "You can find the files and subfolders from " & FromPath & " in " & ToPath
End Sub
What i want is, that the user could get the option with a messagebox, if the enter their name, de folder will be automatically stored in the right place
lets say: G\project\peter
and another user : G\project\charlie
could anyone please help me out here.
many thnx
who could help me out.
i'm using this code:
copy Macro
Dim FSO As Object
Dim FromPath As String
Dim ToPath As String
FromPath = "C:\project/test"
ToPath = "G:\Project\test\" '<< Change
'If you want to create a backup of your folder every time you run this macro
'you can create a unique folder with a Date/Time stamp.
'ToPath = "C:\Users\Ron\" & Format(Now, "yyyy-mm-dd h-mm-ss")
If Right(FromPath, 1) = "\" Then
FromPath = Left(FromPath, Len(FromPath) - 1)
End If
If Right(ToPath, 1) = "\" Then
ToPath = Left(ToPath, Len(ToPath) - 1)
End If
Set FSO = CreateObject("scripting.filesystemobject")
If FSO.FolderExists(FromPath) = False Then
MsgBox FromPath & " doesn't exist"
Exit Sub
End If
FSO.CopyFolder Source:=FromPath, Destination:=ToPath
MsgBox "You can find the files and subfolders from " & FromPath & " in " & ToPath
End Sub
What i want is, that the user could get the option with a messagebox, if the enter their name, de folder will be automatically stored in the right place
lets say: G\project\peter
and another user : G\project\charlie
could anyone please help me out here.
many thnx