how to compare the active cell value to the previous cell's value
ActiveCell.Offset(-1, 0).Value - is correct to get the value above the
active cell. Try it.
If ActiveCell.value < ActiveCell.Offset(-1,0).Value then
'take action
End If
you might want to put this in the worksheet change event to detect changes
in column A something like....
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 Then
If ActiveCell.Value < ActiveCell.Offset(-1, 0).Value Then
MsgBox "Do something"
End If
End If
End Sub
--
Cheers
Nigel
"crimsonkng" wrote in message
...
I have a list of about 55,000 entries in Column A. Though sorted by
value,
the values change at various/random times. I need to determine, in a
macro,
when the value changes so that I can take action to do something else.
So,
how can I say:
If ActiveCell.Value < (the value of the cell directly above it) Then
takeaction
In other words, I don't know how to refer to the cell directly above the
current cell. It can't be the exact address because there are thousands
of
different address. Maybe it has something to do with
ActiveCell.Offset(-1,
0) but I don't think that's quite it.
Thanks. Dan
|