SaveAs using Hyperlink/Path in a cell

S

SJW_OST

I would like to enter the path to where I want to SaveAs in a cell either as
a regular entry or a Hyperlink, whichever way will work best, and have my VB
code use that Hyperlink path and auto save file name to save a workbook.
Example;
Cell A1 has H:\Myfolder entered or hyperlink

My VB code would perform a "ActiveWorkbook.SaveAs Filename:=" senerio and at
this point it would read Cell A1 for the path and use
\" & "MyFile_" & format(now,"mmddyy_hhmmss") & ".xls or some other naming
convention like just \MyFile.xls to name the file.

Is this possible? Your help is greatly apprpeciated.
 
G

Gary''s Student

Cell A1 has H:\Myfolder\ entered. Then:

Sub ost()
Dim MyFile As String
MyFile = "sjb"
pathh = Range("A1").Value
tagg = Format(Now(), "mmddyy_hhmmss")
MsgBox (tagg)
ActiveWorkbook.SaveAs Filename:=pathh & MyFile & tagg & ".xls"
End Sub
 

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