Thread: Cell Reference
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Brian Brian is offline
external usenet poster
 
Posts: 3
Default Cell Reference

I'm looking for tips on how to reference the first or second cell in a row.

Specifically a calculation in J3:J1000 references a number value in J1 and K1 as well as a date value in J2 and K2 (=J2 and < K2). Likewise a calculation in K3:K1000 references a number value in K1 and L1 as well as a date value in K2 and L2. Also there is a reference to a date in E3:E1000 and a calculation done with a value in I3:I1000.

I have this setup as formulas which work fine but am trying to rewrite in VBA. I am not looking for the whole formula to be written in VBA, just some help in how to reference a specific cell in a column.

The formula I'm using now is:

=IF(AND(DATE(YEAR($Q5),MONTH($Q5)+($J5+(ROUNDDOWN( ABS(R$1/$J5),0)*$J5)),DAY($Q5))=R$2,DATE(YEAR($Q5),MONTH( $Q5)+($J5+(ROUNDDOWN(ABS(R$1/$J5),0)*$J5)),DAY($Q5))<S$2),DATE(YEAR($Q5),MONTH( $Q5)+($J5+(ROUNDDOWN(ABS(R$1/$J5),0)*$J5)),DAY($Q5)),"")

The bold areas are where I am trying ot reference the first or second rows.

Thanks,

Brian