ktab
Well-known Member
- Joined
- Apr 21, 2005
- Messages
- 1,297
Hello,
I have the following problem with the code:
Dim fsoObj As Scripting.FileSystemObject
Const stPathFiles As String = ???????
Const stTarget As String = ????????
Set fsoObj = New Scripting.FileSystemObject
With fsoObj
If Not .FolderExists(stTarget) Then .CreateFolder (stTarget)
End With
fsoObj.CopyFile Source:=stPathFiles, Destination:=stTarget, OverWriteFiles:=True
Set fsoObj = Nothing
Where the bold ?? are how can i give as string a range?
I want to handle the code from userform so in case that i want to change path, just change, let's say sheet1.range("a1").value (e.g. c:\program files\kostas\)in a textbox and assign new value without having to change code all the time.
(if Const stPathFiles As String = sheet1.range("a1").value )
I hope my question is clear enough (i doubt)
Thank you
Kostas
I have the following problem with the code:
Dim fsoObj As Scripting.FileSystemObject
Const stPathFiles As String = ???????
Const stTarget As String = ????????
Set fsoObj = New Scripting.FileSystemObject
With fsoObj
If Not .FolderExists(stTarget) Then .CreateFolder (stTarget)
End With
fsoObj.CopyFile Source:=stPathFiles, Destination:=stTarget, OverWriteFiles:=True
Set fsoObj = Nothing
Where the bold ?? are how can i give as string a range?
I want to handle the code from userform so in case that i want to change path, just change, let's say sheet1.range("a1").value (e.g. c:\program files\kostas\)in a textbox and assign new value without having to change code all the time.
(if Const stPathFiles As String = sheet1.range("a1").value )
I hope my question is clear enough (i doubt)
Thank you
Kostas