Need Save As Macro with date in filename

rodj44137

New Member
Joined
Jun 12, 2011
Messages
2
Am running Excel 2000 on computer for members to input their volunteer hours. They are not all Excel users or even computer users.
Want them to be able to simply click on a logo picture to save the file and want the file to be saved in the same directory with the file name "signin-xxxxxxx.xls" where "xxxxxxx" is the current date in the format "ddmmmyy".
I have no experience with Excel/VBA macros.

Please help. This is for the Ohio Naval Militia, an all non-paid volunteer branch of the Ohio Adjutant General's Department (www.navalmilitia.ohio.gov)
Thanks,
CDR Rod Joye
Operations Officer
Ohio Naval Militia
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Hi Rod and Welcome to the Board.
This will save as requested
Code:
Sub SaveIt()
Dim Fname As String, sname As String
Application.ScreenUpdating = False
Fname = Format(Date, "dd-mm-yy") & ".xls"
sname = ThisWorkbook.Path
Set wb = ActiveWorkbook
        With wb
            .SaveAs sname & "\Signin- " & Fname
            .Close
        End With
Application.ScreenUpdating = True
End Sub
 
Upvote 0
Or:-
Code:
Format(Date, "ddmmmmyy")

To insert the macro code, right-click the worksheet tab and click View Code to open the VBA editor, then go Insert > Module and paste the code into the module window. Close the VBA editor.

Create the button/shape/picture on the worksheet, right-click it, click Assign Macro and select SaveIt.

That should do it.
 
Last edited:
Upvote 0
Thanks for the pickup Ruddles....**** copy and paste ....LOL !!
 
Upvote 0
Thanks Michael M and Ruddles. Sorry for the delay, but can only work on this on weekends.
Your solutions works great!
Thanks again!

Rod
 
Upvote 0

Forum statistics

Threads
1,224,503
Messages
6,179,134
Members
452,890
Latest member
Nikhil Ramesh

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