View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
sylink sylink is offline
external usenet poster
 
Posts: 30
Default DATE IN COMPUTATION

I tried without success to compute declaring date as shown below. How
do I declare dates correctly so the formula will compute?

Dim dt, lp1, yb As Date

dt = DateSerial(2008, 1, 31)
lp1 = DateSerial(2007, 12, 31)
yb = DateSerial(2008, 1, 1)


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