Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Date each active tab upon save
I would like to write a macro that would write the date & time to a cell in
the active worksheet tab, the same location for each tab, upon saving the workbook. Could someone help me with this macro? Thanks, Ken |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Date each active tab upon save
Sub demo()
Dim w As Worksheet For Each w In Worksheets w.Activate Range("A1") = Now() Next End Sub -- Gary's Student "Ken King" wrote: I would like to write a macro that would write the date & time to a cell in the active worksheet tab, the same location for each tab, upon saving the workbook. Could someone help me with this macro? Thanks, Ken |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Date each active tab upon save
Gary''s Student wrote:
Sub demo() Dim w As Worksheet For Each w In Worksheets w.Activate Range("A1") = Now() Next End Sub I think the writer asks for a way to mark only the active sheet each time a book is saved. If you put it into auto close, then it could run when the book is closed. Sub auto_close() Activesheet.Range("A1").Value = Now() End Sub I don't know how to modify ActiveWorkbook.Save so that it includes the desired code. As an alternative, instead of using the File:Save menu or the Save button, you could create your own menu item or toolbar button called MarkandSave that had the following code. Sub MarkandSave Activesheet.Range("A1").Value = Now() Activeworkbook.Save End Sub John |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Date each active tab upon save
"John Collins" wrote: Gary''s Student wrote: Sub demo() Dim w As Worksheet For Each w In Worksheets w.Activate Range("A1") = Now() Next End Sub I think the writer asks for a way to mark only the active sheet each time a book is saved. If you put it into auto close, then it could run when the book is closed. Sub auto_close() Activesheet.Range("A1").Value = Now() End Sub I don't know how to modify ActiveWorkbook.Save so that it includes the desired code. As an alternative, instead of using the File:Save menu or the Save button, you could create your own menu item or toolbar button called MarkandSave that had the following code. Sub MarkandSave Activesheet.Range("A1").Value = Now() Activeworkbook.Save End Sub John John, This is exactly what I want, but I forgot to include adding the username (person who is modifying tab) to a cell below. Thanks, Ken |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I create a schedule from a list of dates ? | Charts and Charting in Excel | |||
How to add todays date (static) to the current active cell using m | Excel Discussion (Misc queries) | |||
Mileage Claim Formula | New Users to Excel | |||
Adding a control button to insert a date in the active cell. | Excel Discussion (Misc queries) | |||
Excel :Save date function | Excel Worksheet Functions |