Hello, I have the below code to rename an existing folder but it gives me error '53 file not found when I run it. When I debug, it highlights me this line ----> Name OldFolderName As NewFolderName. Inside the existing folder is a PDF file that I do not need to change the name. I just need to change or rename the existing folder but it keeps giving me error. Can I please have your help?
I av ethe following
Thank you.
I av ethe following
VBA Code:
Private Sub CommandButton1_Click()
'Update Folder Name
If Me.ComboBox1.Value = "" Then
MsgBox "Part# can Not be Blank!", vbExclamation, "Part#"
Exit Sub
End If
Dim Part# As String
Part# = ComboBox1.Value
Dim OldFolderName As String, NewFolderName As String
Dim rowselect As Long
Application.ScreenUpdating = False
rowselect = Me.ComboBox1.ListIndex + 1
Sheets("Data").Select
Cells(rowselect, 15) = Me.TextBox2.Value
OldFolderName = "Z:\TWE\Project\Folders" & Part#
NewFolderName = "Z:\TWE\Project\Folders" & Part# & "-Done"
Name OldFolderName As NewFolderName
Application.ScreenUpdating = True
End Sub
Thank you.