LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Incorporating DATE into formula

Having declared "dt" as date constant, how do i incorporate it into
formula involving cell calculation as shown below.

Dim z As Long
Dim dt As Date

dt = 31 / 12 / 2004
z = 2

Do While Range("A" & z) < ""

If Range("A" & z).Value < Range("A" & z + 1).Value And Range("G" &
z).Value dt Then

Range("R" & z).Select
ActiveCell.FormulaR1C1 = "=((dt-RC[-12])+1)*RC[-7]*(RC[-4]/36600"

ElseIf Range("A" & z).Value < Range("A" & z + 1).Value And Range("G" &
z).Value <= dt Then

Range("R" & z).Select
ActiveCell.FormulaR1C1 = "=(dt-RC[-12])*RC[-7]*(RC[-4]/36600"

Else
Range("R" & z).Select
ActiveCell.FormulaR1C1 = 0

End If
z = z + 1
Loop

 
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
INCORPORATING A ROW NUMBER INTO A FORMULA RANGE Morton Detwyler[_2_] Excel Worksheet Functions 0 December 2nd 08 09:18 PM
Incorporating INDEX function into Array Formula (CNTRL-SHIFT-ENTER ExcelMonkey Excel Worksheet Functions 4 February 5th 07 08:01 PM
Incorporating text into cell w/ formula? djarcadian Excel Discussion (Misc queries) 3 August 10th 06 11:17 PM
Incorporating cell content into a message in a formula KimberlyC Excel Worksheet Functions 3 April 24th 05 08:32 PM


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