Formula to text query / Save file as question

Dazzybeeguy

Board Regular
Joined
Jan 6, 2022
Messages
72
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
I have a spreadsheet that has a formula that links bits of information from the data and concatenates it to a cell.

I want the user to save the file with that reference.

I can tell them to copy and paste values and copy that pasted information from the formula bar and then do s save as and paste that reference. Is there an easier way. ? Maybe some formula or VBA?
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
I dont know anything about VBA, I have found this code below and I can change the Path to the correct location, and can see how to add it to the file. I want the user to open the password protected original file. I want them to add the data they have to it, then want it to save as the Ref in cell B12. Just not sure how to achieve that


Private Sub filename_cellvalue()
'Update 20141112
Dim Path As String
Dim filename As String
Path = "D:\SOFTEKO\excel vba save as file format"
filename = Range("BS12")
ActiveWorkbook.SaveAs filename:=Path & filename & ".xls", FileFormat:=52
End Sub
 
Upvote 0
I also found code below for a button but it saves to Documents folder and I want it saved to the location file is in

Private Sub CommandButton1_Click()
Dim mFileName As String
mFileName = Range("Bs12").Value
ActiveWorkbook.SaveAs (mFileName)
End Sub
 
Upvote 0
I manged to solve it via trial and error. The code linked to the Command Button is now

Private Sub CommandButton1_Click()
Dim mFileName As String
Path = "ADD YOUR FILE LOCATION HERE\"
filename = Range("A1")
ActiveWorkbook.SaveAs filename:=Path & filename & ".xlsM", FileFormat:=52
End Sub
 
Upvote 0
Solution

Forum statistics

Threads
1,214,798
Messages
6,121,636
Members
449,043
Latest member
farhansadik

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top