Macro syntax: SaveAs Filename=ActiveCell.Text . BUT to a specified folder

M

magnus.ferman

Hi, I would like to "save as" with the active cell value to a
specified folder.
If use SaveAs Filename=ActiveCell.Text it save to My documents which I
don't want.
Any tips? Thanks in advance / Magnus

ActiveWorkbook.SaveAs Filename:=ActiveCell.Text, FileFormat:=xlNormal
_
, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False
 
A

aidan.heritage

Hi, I would like to "save as" with the active cell value to a
specified folder.
If use SaveAs Filename=ActiveCell.Text it save to My documents which I
don't want.
Any tips? Thanks in advance / Magnus

ActiveWorkbook.SaveAs Filename:=ActiveCell.Text, FileFormat:=xlNormal
_
, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False

SaveAs filename:="C:\temp\" & activecell.text

obviously replace my example c:\temp with whatever path you want!!!
 
S

steve_doc

answer taken from another thread on same subject from Bob Phillips

sFilename = Format(Worksheets("Sheet1").Range("A1").Value, "yyyy-mm-dd")
ans = MsgBox ("Save file as " & sFilename)
if ans = vbOK Then
Activeworkbook.SaveAs Filename:= sFilename
End If

Above should give you the general idea, although if memory serves this will
still save to your default "My Documents", will search for another method as
this was a question I asked on this NG a while ago

HTH
 
Z

Zone

If you know the path in which you want to save the file, just add the path
to the filename:
ActiveWorkbook.SaveAs Filename:="C:\Test\" & ActiveCell.Text
HTH, James
 

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