Hello all,
I have a fairly simple code that selects a source file and then moves it to a new location and renames it. My issue is, if I put the location directly in the code it works. If I try to use a cell reference that has the same location in the cell, it doesn't. Not sure why as similar functions using the identical cell reference seems to work.
Any help would be greatly appreciated!
I have a fairly simple code that selects a source file and then moves it to a new location and renames it. My issue is, if I put the location directly in the code it works. If I try to use a cell reference that has the same location in the cell, it doesn't. Not sure why as similar functions using the identical cell reference seems to work.
VBA Code:
Sub Prologue()
Dim OldName, NewName
'OldName = "P:\Servicing\Prologt.csv": NewName = "P:\Servicing - 2. Specific\Crest - 37\5. Reporting\c. Daily Reports\Prologue\2021\2021.03\2021.03.24\Prologt_03-24-2021.csv"
OldName = "P:\Servicing\Prologt.csv": NewName = (Sheets("DAILY02").Range("D6").Value)
Name OldName As NewName
End Sub