File system objects VBA

Copper Contributor

If I am looping through a sub folder and I'd like to change folder path like:

Dim fol As Scripting.folder

'if Sheet1.Range("f" & nxtR) is listed path on a cell (range).

Set fol = FSO.GetFolder(Sheet1.Range("f" & nxtR)), this seems not to do a trick. Any suggestion please?

2 Replies

@Rob233 

Does this work?

 

Set fol = FSO.GetFolder(Worksheets("Sheet1").Range("F" & nxtR).Value)

@Hans Vogelaar didn't work. However, I worked my code around for solution.