renaming a file based on text in a cell
renaming a file based on text in a cell
(OP)
Hey folks,
I'm trying to rename a file to whatever text is in a particular cell.
I can't seem to find a way to accomplish this. Seems simple I suppose. Can anyone point me in the right direction?
I have no problem using Name OldName As NewName, but how do I define NewName as whatever text is in a particular cell?
I'm new to VBA so please bear with me. I'm sure this shouldn't be difficult.
Thanks,
I'm trying to rename a file to whatever text is in a particular cell.
I can't seem to find a way to accomplish this. Seems simple I suppose. Can anyone point me in the right direction?
I have no problem using Name OldName As NewName, but how do I define NewName as whatever text is in a particular cell?
I'm new to VBA so please bear with me. I'm sure this shouldn't be difficult.
Thanks,





RE: renaming a file based on text in a cell
CODE
myfilename = Range("A37").Value
myfilename = "c:\" & myfilename & ".txt"
Name "c:\test.txt" As myfilename
End Sub
Good Luck
johnwm
________________________________________________________
To get the best from these forums read FAQ731-376 before posting
Steam Engine enthusiasts
Steam Engine Prints
RE: renaming a file based on text in a cell
RE: renaming a file based on text in a cell
Good Luck
johnwm
________________________________________________________
To get the best from these forums read FAQ731-376 before posting
Steam Engine enthusiasts
Steam Engine Prints