VBA Save as dialog box opening

bliven731

New Member
Joined
Aug 29, 2013
Messages
22
Is there a way to use VBA to open the save as dialog box, set a default name from cell information, and pick the save as file type?

Basically I want it to select sheet 3, Do file save as, default the name as (if I put quote marks I want the cell contents), "D3" "B3"-"C3" So it would be 123456 1-2019 (123456 is D3 contents, 1 is B3 contents, 2019 is C3 contents, and also make the save as file type "CSV (Comma delimited)". That is where the macro would end so that the end user could select where they actually want to save the file. It obviously has to select sheet 3 first because CSV only saves a single sheet.

The file name part is not required if that's too hard to do, the important part is selecting the file type, but the name thing would be nice if it's easy.
 
Are you saving the macro or any other worksheets into the same file?

Also change the file format to CVS too.
ActiveWorkbook.SaveAs Filenames, FileFormat:=xlCSV
 
Upvote 0

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Are you saving the macro or any other worksheets into the same file?

Also change the file format to CVS too.
ActiveWorkbook.SaveAs Filenames, FileFormat:=xlCSV

I believe that last thing fixed it. The macro and the other worksheets aren't going to be in the CSV file, they will be in a macro enabled workbook.

I'm not getting either error message after fixing that line in the code.

Thank you!
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

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