Save file as Cell Value

R

Roger

Hi Everyone,

I have the below routine set to copy a page to my desktop. Is there a way
to have it change the save name to a particular cell's value? If Range(“L6â€)
equals a certain word, I would like it to save as that particular name.

Thanks in advance for your thoughts - Roger

Sub Finalstop()

ActiveSheet.Copy
ChDir "C:\Documents and Settings\Roger\Desktop"
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\Roger\Desktop\New File.xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False
ActiveWorkbook.Close

End
 
F

FSt1

hi
this might work...
Dim mypath As String
Dim nrng As Range
Dim fname As String
Set nrng = Range("A1")
mypath = "C:\your\file\path\"
fname = nrng.Value & ".xls"
ActiveWorkbook.SaveAs Filename:= _
mypath & fname, FileFormat:= _
xlNormal, Password:="", _
WriteResPassword:="", _
ReadOnlyRecommended:=False, _
CreateBackup:=False

regards
FSt1
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top