| ||||||||||||||||||||||||||||||||||||||||||||||||||
if activecell.offset()=activecell
|
Author | Message |
---|---|
![]() 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 |
|
Wed, 10 Mar 2004 13:10:28 GMT | |
![]() |
|
![]() Gerry
what do you mean by "without any success" ? This works fine: If ActiveCell.Offset(0, -2).Value = ActiveCell.Offset(1, -2).Value Then ... with A2 = 2 and A3 = 2 and the Active Cell being C2. And there's no 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 |
|
Wed, 10 Mar 2004 16:55:23 GMT | |
![]() |
|
![]() 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 If ActiveCell.Offset(0, -2) = ActiveCell.Offset(1, -2) then both should work ! |
|
Wed, 10 Mar 2004 19:39:53 GMT | |
![]() |
|
![]() Hi Gerry:
The only reason this wouldn't work is if the active cell was in column A or 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 |
|
Wed, 10 Mar 2004 20:39:45 GMT | |
![]() |
|
![]() 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 Is that what you are trying to do? Regards,
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 |
|
Wed, 10 Mar 2004 20:47:55 GMT | |
![]() |
|
![]() 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 |
|
Wed, 10 Mar 2004 21:31:58 GMT | |
![]() |
|
![]() 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 ActiveCell.Offset(1, -2).Range("A1") then > > Here is what I have tried, without any success. > > If ActiveCell.Offset(0, -2).Value = ActiveCell.Offset(1, -2).Value Then > > TIA > Have you tried with : > If ActiveCell.Offset(0, -2) = ActiveCell.Offset(1, -2) then Quote: > both should work ! |
|
Wed, 10 Mar 2004 23:13:03 GMT | |
Page 1 of 1 |
[ 7 post ] |