Save file as information in cells

  • Thread starter Thread starter Shona
  • Start date Start date
S

Shona

Hi

I have the following but I actually want to save the file as information
from 2 different cells (named)with a space between. The cells are not next
to each other. Alternatively 3 different named ranges and I can put a space
in the middle one

ChDir "C:\DATA"
Application.Goto Reference:="mydirectory"
ChDir ActiveCell()
Application.Goto Reference:="myfilename1"
ActiveWorkbook.Names.Add Name:="myfilename1",
RefersToR1C1:=ActiveCell()
ActiveWorkbook.SaveAs FileName:=ActiveCell(), FileFormat:=xlNormal, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False

Does anyone know how I do this?

Thanks Shona
 
Hi Shona,

This saves a file using the value from the activecell and B27

ChDir "C:\DATA"
Application.Goto Reference:="mydirectory"
ChDir ActiveCell()
Application.Goto Reference:="myfilename1"
ActiveCell.Name = "myfilename1"
ActiveWorkbook.SaveAs _
Filename:=ActiveCell().Value & " " & Range("B27").Value, _
FileFormat:=xlNormal, _
Password:="", _
WriteResPassword:="", _
ReadOnlyRecommended:=False, _
CreateBackup:=False

or this with the activecell & a cell 3 columns right

ChDir "C:\DATA"
Application.Goto Reference:="mydirectory"
ChDir ActiveCell()
Application.Goto Reference:="myfilename1"
ActiveCell.Name = "myfilename1"
ActiveWorkbook.SaveAs _
Filename:=ActiveCell().Value & " " &
Activecell.Offset(0,3).Value, _
FileFormat:=xlNormal, _
Password:="", _
WriteResPassword:="", _
ReadOnlyRecommended:=False, _
CreateBackup:=False


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Back
Top