ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   SaveAs using Hyperlink/Path in a cell (https://www.excelbanter.com/excel-programming/416145-saveas-using-hyperlink-path-cell.html)

SJW_OST[_2_]

SaveAs using Hyperlink/Path in a cell
 
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.

Gary''s Student

SaveAs using Hyperlink/Path in a cell
 
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

--
Gary''s Student - gsnu200801


"SJW_OST" wrote:

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.



All times are GMT +1. The time now is 06:05 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com