View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
tim tim is offline
external usenet poster
 
Posts: 105
Default Cell Reference in a Macro

I am looping through a macro, testing the contents a data
in column A. If I find a "P" in the first position clomun
A, I want to capture the value, if there is one, in column
C and column D in that row. I want to keep a running
balance of the sum of those values by column.

I am not sure how to reference those cells when I find
a "P" in column A.

Range("A1").Select
For I = 1 to 100
If Left((ActiveCell,1)="P" Then
TotalC = TotalC + ???
TotalD = TotalD + ???

How do I reference the cells in C and D to add the values
to the running totals?

Something like ActiveCell.Offset(0,2).Value?

TIA.