I am trying to re-edit the below VBA code (Works perfectly) that would prompt the user a dialog box to select the Source folder and another dialog box to choose their choice of target folder. Any help would be appreciated.
The code below, works wonderfully within my own directory. But it would be great to make it flexible for other users to choose their own choice of folders.
Option Explicit
**SRC_FOLDER = GetFolder()
DEST_FOLDER = GetFolder()**
Dim Rng As Range, fPath, fName
Dim maxRows As Long, maxCols As Long, r As Long, c As Long
Set Rng = Selection
maxRows = Rng.Rows.Count
maxCols = Rng.Columns.Count
'assuming the first row in ther selection is the headers...
' otherwise, start at 1
For r = 2 To maxRows
fPath = DEST_FOLDER '<<set starting point
For c = 2 To maxCols
fPath = fPath & "\" & Rng.Cells(r, c) '<<build next level
If Len(Dir(fPath, vbDirectory)) = 0 Then MkDir fPath
On Error Resume Next
Next c
'create file name
fName = Right("0000000000" & Rng.Cells(r, 1).Value, 10) & ".pdf"
'copy to fpath
FileCopy SRC_FOLDER & fName, fPath & "\" & fName
Next r
End Function
This code works perfectly, thanks to @Tim Williams I just want this macro to be more user friendly with other users