Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default set cell to today's date macro

I have a workbook where i want the date to be set in cell b23 to todays date every time the wkbook is opened
also every sheet in the workbook has a cell which requires this date but they are not all b23 can this be don

any help appreciate

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default set cell to today's date macro

Colm

In the ThisWorkbook Module:

Private Sub Workbook_Open()
With ThisWorkbook
.Sheets("Sheet1").Range("B23") = Date
.Sheets("Sheet2").Range("A23") = Date
.Sheets("Sheet3").Range("A2") = Date
'etc
End With
End Sub


--
HTH
Roger
Shaftesbury (UK)



"Colm O'Brien" wrote in message
...
I have a workbook where i want the date to be set in cell b23 to todays

date every time the wkbook is opened.
also every sheet in the workbook has a cell which requires this date but

they are not all b23 can this be done


any help appreciated



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default set cell to today's date macro

Thanks Roger that worked a trea
col


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default set cell to today's date macro

use the Workbook_Open event in the ThisWorkbook Module

http://www.cpearson.com/Excel/events.htm

then include code like:

worksheets("Sheet1").Range("B23").Value = Date
worksheets("Sheet2").Range("C19").Value = Date


or just set it for B23 and have formulas in the other sheets in the
appropriate cells that point to B23 on Sheet1 (as an example.

You might also look at the worksheetfunction

=Today()

maybe that will give you what you want without coding.

--
Regards,
Tom Ogilvy

"Colm O'Brien" wrote in message
...
I have a workbook where i want the date to be set in cell b23 to todays

date every time the wkbook is opened.
also every sheet in the workbook has a cell which requires this date but

they are not all b23 can this be done


any help appreciated



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 filter by today's date(changing) and before in a macro? Laurie Excel Worksheet Functions 0 October 29th 09 07:31 PM
Macro to jump to today's date Victor Delta Excel Discussion (Misc queries) 9 July 4th 06 08:52 PM
A macro for the today's date...not the current date abxy[_18_] Excel Programming 7 February 8th 04 11:05 PM
Macro to filter on today's date Mike Boardman Excel Programming 2 October 3rd 03 01:49 AM
Macro to filter on today's date Mike B[_4_] Excel Programming 0 October 1st 03 09:17 AM


All times are GMT +1. The time now is 05:27 AM.

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"