Macro stop and enter

maguirej

New Member
Joined
Sep 9, 2002
Messages
13
I have a macro shared by many...where they will want to save their excel file as a different name than the others. How do I code in a stop so that a person enters the directory and file name of their choice before the macro continues?
This message was edited by maguirej on 2002-09-10 11:04
This message was edited by maguirej on 2002-09-10 11:04
 

Some videos you may like

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

maguirej

New Member
Joined
Sep 9, 2002
Messages
13
Thank you for your quick response!
I am very new to VB and the help/books will take too long (under deadline) - my class on this isn't for another few weeks...I'm asked to accomplish things without the time or tools (what else is new). Could you elaborate with an example?
 

hedrijw

Board Regular
Joined
Jun 17, 2002
Messages
210
Instead of using a message box, you can use the GetSaveasFileName method. This will throw up the standard box with a default name. You still have to save the file.

Sub name_file()
fileSaveName = Application.GetSaveAsFilename("OriginalName", _
fileFilter:="Excel Files (*.xls), *.xls")
If fileSaveName <> False Then
MsgBox "Save as " & fileSaveName
End If
End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,122,469
Messages
5,596,326
Members
414,053
Latest member
Dual Showman

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
Top