Good morning and happy Friday!!
I have found a need to use vba to rename a file using the name of the parent folder name while also using the parent folder name to fill in portions of a form.
I have to do this quite often and the tedious process of copy-pasting the info from the parent folder into the form as well as having to wait for one drive to sync and rename the file as the folder name.
I would think this can be done while editing the file when done being able to press the button to do actions above and saving the file
Any help would be greatly appreciated.
I have found a need to use vba to rename a file using the name of the parent folder name while also using the parent folder name to fill in portions of a form.
I have to do this quite often and the tedious process of copy-pasting the info from the parent folder into the form as well as having to wait for one drive to sync and rename the file as the folder name.
I would think this can be done while editing the file when done being able to press the button to do actions above and saving the file
VBA Code:
Sub Test()
Dim oldName, newName
Dim ws As WorkSheet
Dim wb As Workbook
oldName = ActiveWorkbook: newName = ActiveWorkbook.Path & "\" ' Define file names.
Name oldName As oldName ' Rename file.
End Sub