Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Formula for a date

Can anyone advice me on how get the current date to display in a field
when I open a excel template I created.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Formula for a date

Not sure what you mean by "Field".

Code :
Range("A1").Value = Format(Date, "dd/mm/yy")

or, a simple formula in a cell :-
=NOW() and format cell accordingly

--
Message posted from http://www.ExcelForum.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Formula for a date



Thanks for your help. I guess by field I meant cell! The formulas you
gave me worked thanks. Can you also set it that the date will only
appear when you select that specific cell with the formula in it?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default Formula for a date

On Wed, 26 May 2004 01:59:37 -0700, Frans Gerber wrote:



Thanks for your help. I guess by field I meant cell! The formulas you
gave me worked thanks. Can you also set it that the date will only
appear when you select that specific cell with the formula in it?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


You could try an event-triggered macro like:

======================
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Intersect(Target, [A5]) Is Nothing Then
Range("a5").Font.Color = Range("a5").Interior.Color
Else
Range("a5").Font.Color = vbBlack
End If
End Sub
======================

Assumes your formula is in A5.

To enter, right click on the worksheet tab and select View Code. Paste the
above code into the window that appears.


--ron
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Formula for a date

Great stuff thank you!

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
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
Create a formula in a date range to locate a specific date - ecel util Excel Discussion (Misc queries) 0 February 19th 07 03:03 PM
Excel Formula to calulate number of days passed from date to date K. Mack Excel Discussion (Misc queries) 8 January 4th 07 11:27 PM
Date Function formula that will return the date of a specific week Greg Excel Worksheet Functions 4 June 12th 06 05:07 PM
Formula for determining if two date columns fall within specific date range Igottabeme Excel Worksheet Functions 2 April 21st 06 02:50 AM
Formula for determining if two date columns fall within specific date range Igottabeme Excel Discussion (Misc queries) 1 April 20th 06 10:03 PM


All times are GMT +1. The time now is 09:58 AM.

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"