if activecell.offset()=activecell.offset 
Author Message
 if activecell.offset()=activecell.offset

I want to check if 2 cells equal then go to next step

Here is what I have tried, without any success.

If ActiveCell.Offset(0, -2).Value = ActiveCell.Offset(1, -2).Value Then

TIA
Gerry



Wed, 10 Mar 2004 13:10:28 GMT  
 if activecell.offset()=activecell.offset
Gerry

what do you mean by "without any success" ?  This works fine:

If ActiveCell.Offset(0, -2).Value = ActiveCell.Offset(1, -2).Value Then
    MsgBox "equal"
End If

... with A2 = 2 and A3 = 2 and the Active Cell being C2.  And there's no
message box if the cells aren't equal.

Regards

Trevor


Quote:
> I want to check if 2 cells equal then go to next step

> Here is what I have tried, without any success.

> If ActiveCell.Offset(0, -2).Value = ActiveCell.Offset(1, -2).Value Then

> TIA
> Gerry



Wed, 10 Mar 2004 16:55:23 GMT  
 if activecell.offset()=activecell.offset

Quote:

> I want to check if 2 cells equal then go to next step

> Here is what I have tried, without any success.

> If ActiveCell.Offset(0, -2).Value = ActiveCell.Offset(1, -2).Value Then

> TIA
> Gerry

Have you tried with :

If ActiveCell.Offset(0, -2) = ActiveCell.Offset(1, -2) then
or
If ActiveCell.Offset(0, -2).Range("A1") = ActiveCell.Offset(1, -2).Range("A1") then

both should work !
;-) S?ren



Wed, 10 Mar 2004 19:39:53 GMT  
 if activecell.offset()=activecell.offset
Hi Gerry:

The only reason this wouldn't work is if the active cell was in column A or
column B.

Regards,

Vasant.


Quote:
> I want to check if 2 cells equal then go to next step

> Here is what I have tried, without any success.

> If ActiveCell.Offset(0, -2).Value = ActiveCell.Offset(1, -2).Value Then

> TIA
> Gerry



Wed, 10 Mar 2004 20:39:45 GMT  
 if activecell.offset()=activecell.offset
Perhaps you have your row and column references reversed,  this looks at the
cell in the same row as the active cell and the cell one row after the
active cell and two columns to the left.

So if the active cell were d5  this would compare   b5 and b6

Range("d5").Activate
? activeCell.Offset(0,-2).Address
$B$5
? activeCell.Offset(1,-2).Address
$B$6

Is that what you are trying to do?

Regards,
Tom Ogilvy


Quote:
> I want to check if 2 cells equal then go to next step

> Here is what I have tried, without any success.

> If ActiveCell.Offset(0, -2).Value = ActiveCell.Offset(1, -2).Value Then

> TIA
> Gerry



Wed, 10 Mar 2004 20:47:55 GMT  
 if activecell.offset()=activecell.offset
Two possibilities:

1.) Maybe you've got rows and columns confused.

2.)  (more likely) in one of the cells, the 'value' is stored as text.

Cheers,

Andrew

Quote:

> I want to check if 2 cells equal then go to next step

> Here is what I have tried, without any success.

> If ActiveCell.Offset(0, -2).Value = ActiveCell.Offset(1, -2).Value Then

> TIA
> Gerry



Wed, 10 Mar 2004 21:31:58 GMT  
 if activecell.offset()=activecell.offset
Thanks
That worked great!  Maybe the problem I was having is that the cells were
text and not numbers.
Either way it is working now.

Gerry


Quote:
> > I want to check if 2 cells equal then go to next step

> > Here is what I have tried, without any success.

> > If ActiveCell.Offset(0, -2).Value = ActiveCell.Offset(1, -2).Value Then

> > TIA
> > Gerry

> Have you tried with :

> If ActiveCell.Offset(0, -2) = ActiveCell.Offset(1, -2) then
> or
> If ActiveCell.Offset(0, -2).Range("A1") =

ActiveCell.Offset(1, -2).Range("A1") then
Quote:

> both should work !
> ;-) S?ren



Wed, 10 Mar 2004 23:13:03 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Range(activecell, activecell.offset(32).Printout

2. ActiveCell.Offset(x,y).Select

3. ApExcel.Activecell.offset question!!!!!

4. OFFSET without activecell

5. ActiveCell.Offset( , ).Value Lookup

6. ActiveCell + Offset + FormulaArray

7. ActiveCell.Offset(1, 0)

8. ActiveCell.Offset question?

9. Variables with activecell.offset (EX 97)

10. Offsetting ActiveCell to first empty cell


 
Powered by phpBB® Forum Software © phpBB Group