Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 20
Default Using Now() in a Function

I am using the Now() function within a function, to enter a timestamp
as a spreadsheet is populated. Here's the function:

=IF(AND(LEN(D63)<0,MOD(B62,12)=0),NOW(),"")

The function works fine, however, the timestamp continues to update,
as I update my spreadsheet. Is there an excel function - either
preexisting within excel, or easily added - to enter a static
timestamp?

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Using Now() in a Function

You can use an Event Macro. Enter the formula just as you have posted it
(say in Z100). Put this in worksheet code:

Private Sub Worksheet_Calculate()
With Range("Z100")
If .Value = "" Then Exit Sub
.Value = .Value
End With
End Sub

As soon as the cell displays the non-blank value of NOW, the macro will
replace the formula by its static value.
--
Gary''s Student - gsnu200739


" wrote:

I am using the Now() function within a function, to enter a timestamp
as a spreadsheet is populated. Here's the function:

=IF(AND(LEN(D63)<0,MOD(B62,12)=0),NOW(),"")

The function works fine, however, the timestamp continues to update,
as I update my spreadsheet. Is there an excel function - either
preexisting within excel, or easily added - to enter a static
timestamp?


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 252
Default Using Now() in a Function

First click Tools-Options and go to the "Calculation" tab. Check the box
next to "Iteration". This tells Excel to allow circular references.

Now in the cell of interest insert this modified formula, but replace B1
(both of them) with the cell you are entering the formula into.
=IF(AND(LEN(D63)<0,MOD(B62,12)=0),IF(B1="",NOW(), B1),"")

Format as a date and time.

When you enter the formula in the cell the first time it might come up with
something funny like 1/0/1900 12:00 AM. Just change D63 or B62 so that the
result is "". Once you change them back the date will be right and won't
update.

This may seem complicated but it is the only way I know of without using a
macro. Macros are nice, but they have their downsides. It just depends on
your needs/desires. Hope this helps!!

" wrote:

I am using the Now() function within a function, to enter a timestamp
as a spreadsheet is populated. Here's the function:

=IF(AND(LEN(D63)<0,MOD(B62,12)=0),NOW(),"")

The function works fine, however, the timestamp continues to update,
as I update my spreadsheet. Is there an excel function - either
preexisting within excel, or easily added - to enter a static
timestamp?


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
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) [email protected] Excel Worksheet Functions 0 September 5th 06 03:44 PM
Offset function with nested match function not finding host ss. MKunert Excel Worksheet Functions 1 March 21st 06 10:46 PM
Datevlaue function/ day/month/year function Nav Excel Worksheet Functions 7 January 23rd 06 02:31 PM
Emulate Index/Match combo function w/ VBA custom function Spencer Hutton Excel Worksheet Functions 2 May 2nd 05 05:26 PM
Nested IF Function, Date Comparing, and NetworkDays Function carl Excel Worksheet Functions 2 December 29th 04 09:57 PM


All times are GMT +1. The time now is 02:27 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"