LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 47
Default Macro to Insert Current Date into cell - Macro to "Save As"

Figured it out and got it to work. Thanks.

Guy
--
GT


"Brotha Lee" wrote:

Hi Guy,

The following codes will do the trick for you:

Sub SetDate()
'Set cell A1 to the current date
ActiveSheet.Range("A1").Value = Date
End Sub

Sub SaveAs()
'Open the save as dialog box and show the value from A1
Dim myValue As String

myValue = ActiveSheet.Range("A1").Value
Dim fd As Dialog
Set fd = Application.Dialogs(xlDialogSaveAs)

If fd.Show(myValue) = False Then
'User pressed cancel, sheet not saved
'Add any additional code here if necessary
Else
'User has saved the file, update the data in range A1
'Run SetDate macro
SetDate
End If
End Sub

"Guy" wrote:

Windows XP - Office Basic 2003 - Excell 2003

1) I need a macro that will insert the current date into a cell. I do not
want the date to change when the sheet is opened or modified and saved unless
that macro button is selected.

2) I also need a macro that will bring up the "Save As" window when button
is selected. If possible to also insert a particular cell value in name field
of "Save As" window, then save and exit all with same macro.

Thanks,
Guy



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro in WB assigned to toolbar, after "save as" points to differn Activoz_Interpreting Excel Discussion (Misc queries) 1 March 16th 08 04:02 AM
Insert "Proper Function" into existing macro jackel[_14_] Excel Worksheet Functions 10 March 10th 08 04:00 PM
Need the formula or macro. If i enter today date in the cell (Row 1,Column 2) and on tab out, the column 1 cell should be filled with "corresponding Day" of the date kakasay Excel Discussion (Misc queries) 1 January 22nd 07 12:31 PM
Need Formula or macro. If i enter today date in the cell (Row 1,Column 2) and on tab out, the column 1 cell should be filled with "corresponding Day" of the date kakasay Excel Discussion (Misc queries) 1 January 22nd 07 12:31 PM
Is it possible to insert a macro command in an "IF" function? SandyLACA Excel Worksheet Functions 4 November 8th 05 10:46 PM


All times are GMT +1. The time now is 05:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"