pikapikachiu
New Member
- Joined
- Feb 24, 2018
- Messages
- 2
i manage to copy from 1 row of source path folder to destination ( B2 to C2)
but i has trouble to write the code to continue loop copying from 2nd row & so on until empty cell value
can anyone help me to fix the code? i need its can loop continue fro ( B3:until end, to C3 until end)
below is the code of me
Sub sbCopyingAFolder()
Dim FSO
Dim sFolder As String, dFolder As String
sFolder = Range("B2").Value ' souces folder
dFolder = Range("C2").Value ' destination folder
Set FSO = CreateObject("Scripting.FileSystemObject")
If Not FSO.FolderExists(dFolder) Then
FSO.CopyFolder sFolder, dFolder
MsgBox "Folder Copied Successfully to The Destination", vbExclamation, "Done!"
Else
MsgBox "Folder Already Exists in the Destination", vbExclamation, "Folder Already Exists!"
End If
but i has trouble to write the code to continue loop copying from 2nd row & so on until empty cell value
can anyone help me to fix the code? i need its can loop continue fro ( B3:until end, to C3 until end)
below is the code of me
Sub sbCopyingAFolder()
Dim FSO
Dim sFolder As String, dFolder As String
sFolder = Range("B2").Value ' souces folder
dFolder = Range("C2").Value ' destination folder
Set FSO = CreateObject("Scripting.FileSystemObject")
If Not FSO.FolderExists(dFolder) Then
FSO.CopyFolder sFolder, dFolder
MsgBox "Folder Copied Successfully to The Destination", vbExclamation, "Done!"
Else
MsgBox "Folder Already Exists in the Destination", vbExclamation, "Folder Already Exists!"
End If