ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   File save as cell value (https://www.excelbanter.com/excel-discussion-misc-queries/213835-file-save-cell-value.html)

Tony. D

File save as cell value
 
I want to set up a Save As macro button to to save a file as "cell
value".xls. It should have the File Save As box appear with the follwing:

i.e. Cell A1 - MortgageNo
Cell A2 - 12345678

filename = MortgageNo12345678.xls

Can anyone help me out?

Gary''s Student

File save as cell value
 
Sub Macro1()
v = Range("A1").Value & Range("A2").Value
ActiveWorkbook.SaveAs Filename:=ActiveWorkbook.Path & "\" & v
End Sub
--
Gary''s Student - gsnu200820


"Tony. D" wrote:

I want to set up a Save As macro button to to save a file as "cell
value".xls. It should have the File Save As box appear with the follwing:

i.e. Cell A1 - MortgageNo
Cell A2 - 12345678

filename = MortgageNo12345678.xls

Can anyone help me out?


Don Guillett

File save as cell value
 
Sub Macro8()
v1 = Range("a1")
v2 = Range("a2")
ActiveWorkbook.SaveAs Filename:="C:\yourfolder\" & v1 & v2 & ".xls"
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Tony. D" <Tony.
wrote in message
...
I want to set up a Save As macro button to to save a file as "cell
value".xls. It should have the File Save As box appear with the follwing:

i.e. Cell A1 - MortgageNo
Cell A2 - 12345678

filename = MortgageNo12345678.xls

Can anyone help me out?



Tony. D[_2_]

File save as cell value
 
When I copy the text inot my macro button as :

Private Sub CommandButton2_Click()
v = Range("A1").Value & Range("A2").Value
ActiveWorkbook.SaveAs Filename:=ActiveWorkbook.Path & "\" & v
End Sub

I get a runtime error 1004

"Tony. D" wrote:

I want to set up a Save As macro button to to save a file as "cell
value".xls. It should have the File Save As box appear with the follwing:

i.e. Cell A1 - MortgageNo
Cell A2 - 12345678

filename = MortgageNo12345678.xls

Can anyone help me out?


Chris Premo

File save as cell value
 
Tony. D wrote:

I want to set up a Save As macro button to to save a file as "cell
value".xls. It should have the File Save As box appear with the
follwing:

i.e. Cell A1 - MortgageNo
Cell A2 - 12345678

filename = MortgageNo12345678.xls

Can anyone help me out?


Create a "Blank" excel workbook with the following macro. This way the
"Blank" workbook will always be blank and ready to create a new Filled
in version. The Path will need to be change to meet your needs. You
could get sophisticated and work out how to get it to "Ask You Where
you want it to go".




Global strPath As String

Sub NameFile()

strPath = "I:\Database Development Files\BorderManager Filters"

ActiveWorkbook.SaveAs Filename:=strPath & "\" & Range("A1").Value &
" " & Range("A2").Value, _
FileFormat:=xlExcel8, CreateBackup:=False
Application.DisplayAlerts = True
ActiveWorkbook.Save


End Sub

--


Dave Peterson

File save as cell value
 
What's the activeworkbook's path?

And you've double checked the values in A1 and A2, right?

Tony. D wrote:

When I copy the text inot my macro button as :

Private Sub CommandButton2_Click()
v = Range("A1").Value & Range("A2").Value
ActiveWorkbook.SaveAs Filename:=ActiveWorkbook.Path & "\" & v
End Sub

I get a runtime error 1004

"Tony. D" wrote:

I want to set up a Save As macro button to to save a file as "cell
value".xls. It should have the File Save As box appear with the follwing:

i.e. Cell A1 - MortgageNo
Cell A2 - 12345678

filename = MortgageNo12345678.xls

Can anyone help me out?


--

Dave Peterson

Chris Premo

File save as cell value
 
Some one posted this code and thought I'd incorporate it with the code
I gave you.

Sub NameFile()

Dim strngpth As String
strngpth = Application.InputBox("Enter the Desired Save path", , ,
, , , , 2)
Set strng1 = Application.InputBox(prompt:="Enter the Desired First
Cell", Type:=8)
Set strng2 = Application.InputBox(prompt:="Enter the Desired Second
Cell", Type:=8)

strPath = "I:\Database Development Files\BorderManager Filters\"

ActiveWorkbook.SaveAs Filename:=strngpth & strng1.Value & " " &
strng2.Value, FileFormat:=xlExcel8, CreateBackup:=False
Application.DisplayAlerts = True
ActiveWorkbook.Save

End Sub




--



All times are GMT +1. The time now is 03:43 PM.

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