Save file with user input for filename

kjm1969

New Member
Joined
Aug 10, 2011
Messages
1
Hello world!! I am attempting to work in water over my head!! Yea me!!
I need help putting together the code to allow a user to click a button, have an input window pop up and ask for the files name and then save the file in a predetermined location as that file name. I am not all that good at the VBA code. Very much a beginner but I'm leanring everyday. Can anyone offer sugestions for this??
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Try like this

Code:
Sub SaveMe()
Dim fName As String
fName = InputBox("Enter filename")
If fName = "" Then Exit Sub
With ActiveWorkbook
    .SaveAs Filename = .Path & "\" & fName & ".xls"
End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,574
Messages
6,179,634
Members
452,934
Latest member
Jdsonne31

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