I all,
I have a question regarding this script
What it does is read the paths entered in the cells in Column A in excelsheet "folderlist" , and copy it to the current path of the excel where this script is on.
As example:
Cell A1 contains value c:/thispath/folder 1
Cell A2 contains value c:/thispath/folder 2
etc.
The script will copy each folder to the current path.
Now i'm not into VBA code at all, but i would like to change the script, so that the path doesn't need to be entered over and over again, but only inserting the foldernames in the column A would be enough.
So instead of my previous example, i would only have to insert
Cell A1: folder 1
Cell A2: folder 2
etc.
So the "c:/thispath/ " would be implemented in the script.
Is there somebody who can help me out with this please?
Thank you very much for your help
I have a question regarding this script
Code:
Sub wrapper2()
x = 1
Set fs = CreateObject("Scripting.FileSystemObject")
While Sheets("folderlist").Cells(x, 1) <> ""
v = InStrRev(Sheets("folderlist").Cells(x, 1), "\")
dest = ActiveWorkbook.Path & Mid(Sheets("folderlist").Cells(x, 1), v, 99)
Set f = fs.getfolder(Sheets("folderlist").Cells(x, 1))
f.Copy dest
' f.Delete: 'optional step
x = x + 1
Wend
fs = ""
End Sub
What it does is read the paths entered in the cells in Column A in excelsheet "folderlist" , and copy it to the current path of the excel where this script is on.
As example:
Cell A1 contains value c:/thispath/folder 1
Cell A2 contains value c:/thispath/folder 2
etc.
The script will copy each folder to the current path.
Now i'm not into VBA code at all, but i would like to change the script, so that the path doesn't need to be entered over and over again, but only inserting the foldernames in the column A would be enough.
So instead of my previous example, i would only have to insert
Cell A1: folder 1
Cell A2: folder 2
etc.
So the "c:/thispath/ " would be implemented in the script.
Is there somebody who can help me out with this please?
Thank you very much for your help