Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15
Default 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
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
How do I create a schedule from a list of dates ? Gavin Morris Charts and Charting in Excel 2 October 28th 10 04:08 PM
How to add todays date (static) to the current active cell using m JimmyJam75 Excel Discussion (Misc queries) 5 September 6th 06 11:23 AM
Mileage Claim Formula johndavies New Users to Excel 4 August 14th 06 09:24 AM
Adding a control button to insert a date in the active cell. Mike Excel Discussion (Misc queries) 2 February 15th 05 06:27 PM
Excel :Save date function Elodie Excel Worksheet Functions 1 November 25th 04 04:25 PM


All times are GMT +1. The time now is 04:19 PM.

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

About Us

"It's about Microsoft Excel"