Hi All
First up...thanks for any help.
I have adapted a piece of code to go through all excel files and add a string (_zop1, _zop2 etc) to their filename. The problem is that this only works in one folder and does not go through the sub folders. I have tried to add various pieces of code from around the web to make it recursive...to no avail.
All help appreciated. Many thanks.
S
Sub test2()
Dim strFolder As String
Dim strFile As String
strFolder = "Z:\Teams\LEAN Wave 3 Document Store\Transmission Project\test\"
lcv = 1
strFile = Dir(strFolder & "\*.*")
Do While Len(strFile) > 0
If InStr(strFile, ".xls") > 0 Then
Name strFolder & strFile As strFolder & Replace(strFile, ".xls", "_zop" & lcv & ".xls")
lcv = lcv + 1
End If
strFile = Dir()
Loop
End Sub
First up...thanks for any help.
I have adapted a piece of code to go through all excel files and add a string (_zop1, _zop2 etc) to their filename. The problem is that this only works in one folder and does not go through the sub folders. I have tried to add various pieces of code from around the web to make it recursive...to no avail.
All help appreciated. Many thanks.
S
Sub test2()
Dim strFolder As String
Dim strFile As String
strFolder = "Z:\Teams\LEAN Wave 3 Document Store\Transmission Project\test\"
lcv = 1
strFile = Dir(strFolder & "\*.*")
Do While Len(strFile) > 0
If InStr(strFile, ".xls") > 0 Then
Name strFolder & strFile As strFolder & Replace(strFile, ".xls", "_zop" & lcv & ".xls")
lcv = lcv + 1
End If
strFile = Dir()
Loop
End Sub