J
JasonK
i need to run a for/next loop for a selection which i started like
this:
Range("f3:l9").Select
For Each i In Selection
i need to compare the data in f3 with the date in g3 and h3, then f3
with the two cells above it, then the two cells below it and the two
cells to the left of it, for four different comparisions for each cell
in the selection..
if i.value = 1 and (next cell right) = 1 and (two cells right) = 0
then c=c+1
if i.value = 1 and (next cell up) = 1 and (two cells up) = 0 then
c=c+1
etc....
do i use OFFSET to look at the next cell? if so, how do i write that?
also, after "THEN c=c+1" , i need to take a value exactly 9 cells
below the selected cell and copy that value to another variable. Do I
use OFFSET for that?
if the 3 statements are true, then c=c+1 AND x = (value of 9 cells
below f3 + a constant).
I hope this is clear.
I appreciate your help. Everyone in this group has been phenomenal.
Thanks again,
Jason K.
this:
Range("f3:l9").Select
For Each i In Selection
i need to compare the data in f3 with the date in g3 and h3, then f3
with the two cells above it, then the two cells below it and the two
cells to the left of it, for four different comparisions for each cell
in the selection..
if i.value = 1 and (next cell right) = 1 and (two cells right) = 0
then c=c+1
if i.value = 1 and (next cell up) = 1 and (two cells up) = 0 then
c=c+1
etc....
do i use OFFSET to look at the next cell? if so, how do i write that?
also, after "THEN c=c+1" , i need to take a value exactly 9 cells
below the selected cell and copy that value to another variable. Do I
use OFFSET for that?
if the 3 statements are true, then c=c+1 AND x = (value of 9 cells
below f3 + a constant).
I hope this is clear.
I appreciate your help. Everyone in this group has been phenomenal.
Thanks again,
Jason K.