View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
CurtB CurtB is offline
external usenet poster
 
Posts: 8
Default Formula help needed

If the OP can modify the worksheet, a simpler approach is available. Given
"# Days on Market" is in column A. Add "MarketDate" in column B as the date
added to market. In Column A2, add the following code and copy it down:
=Today()-B2

"Bob Phillips" wrote:

Private Sub Workbook_Open()
Dim RunDate As Date
Const RUN_DATE As String = "__RunDate"

On Error Resume Next
RunDate = Evaluate(ThisWorkbook.Names(RUN_DATE).RefersTo)
On Error GoTo 0
If RunDate < Date Then
With Worksheets("Sheet1").Range("A1")
.Value = .Value + 1
End With
End If
ThisWorkbook.Names.Add Name:=RUN_DATE, RefersTo:=Date, Visible:=False

End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code


--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"accessnovice" wrote in message
...
I am working on a template for a work. The document has a column for "# of
Days on Market". I have been looking in help and in my Excel books for a
formula that will add one day to the total number each day the item
remains
on the market. I am not sure how to word what I am looking for in HELP.
What
I need is ex: Today the item has been on the market 14 days. When I open
the
worksheet tomorrow I need it to say 15 days. I looked for something
similar
to =Today() but can't seem to find anything. Thanks.