VBA Code for save as

Bullrides48

New Member
Joined
Jan 8, 2025
Messages
4
Office Version
  1. 2013
Platform
  1. Windows
Hello all, newbie here.
Can ya'll help with a code that takes from range B1:B4 so that when I select a created "Save" button it takes the information entered in these cells and it creates a proper saved name? In other words, the user fills out some information in required cells and the code uses this for the saved naming convention with said information.

Thanks
Snag_2023201a.png

Bull
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Hi and welcome to MrExcel

Do you just want to create the name?
Or do you want the current book to be saved with the created name?
Or do you want to save a copy of the current book with the created name?
Or do you want the Save As dialog window to open and propose the created name?

----- --
I hope to hear from you soon.
Respectfully
Dante Amor
----- --
 
Upvote 0
Hi and welcome to MrExcel

Do you just want to create the name?
Or do you want the current book to be saved with the created name?
Or do you want to save a copy of the current book with the created name?
Or do you want the Save As dialog window to open and propose the created name?

----- --
I hope to hear from you soon.
Respectfully
Dante Amor
----- --
Thank you and thanks for responding, I want to save the file once filled out by it creating the file name once the "save" button is clicked based on information entered by the user in several cells. The user will always have the master or receive a new master per each project.
 
Upvote 0
Thank you and thanks for responding, I want to save the file once filled out by it creating the file name once the "save" button is clicked based on information entered by the user in several cells. The user will always have the master or receive a new master per each project.
Snag_209b989e.png
 
Upvote 0
Try this:

VBA Code:
Sub save_as()
  With ThisWorkbook
    .SaveAs .Path & "\" & [B1] & "-" & [B2] & "-" & Format([B3], "yyyy-mm-dd") & "-" & [B4]
  End With
End Sub

😇
 
Upvote 0

Forum statistics

Threads
1,225,492
Messages
6,185,300
Members
453,286
Latest member
JCM

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