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
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
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?
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,224,271
Messages
6,177,605
Members
452,784
Latest member
talippo

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