View Single Post
  #8   Report Post  
Frank Kabel
 
Posts: n/a
Default

Hi
this would require the SelectionChange event and storing the old row in
a static variable. Not fully tested but try the following then:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Static iOldRow As Long
If Target.Cells.Count 1 Then Exit Sub

If iOldRow < 1 Then
iOldRow = Target.Row
ElseIf iOldRow < Target.Row Then
MsgBox "new row selected: " & Target.Row
iOldRow = Target.Row
End If
End Sub

--
Regards
Frank Kabel
Frankfurt, Germany

"crazybass2" schrieb im
Newsbeitrag ...
I mean that I don't want the event to trigger while I'm in the same

row.

Starting at Cell A1. I want the event to trigger only when I move to

a row
other than 1, (eg A2, A3, A4...etc.)

I don't want the event to trigger if I move from one column to the

other
(A1, B1, C1, D1....ect)



"Frank Kabel" wrote:

Hi
so you may explain what you mean with 'then I change rows'

--
Regards
Frank Kabel
Frankfurt, Germany

"crazybass2" schrieb im
Newsbeitrag

...
That statement triggers only when in row 1 and regardless of

whether
I change
rows.

I need something that will trigger ONLY when I change rows.

For example.

Enter data at A1, tab (no event triggered), enter data at B1,

tab(no
event
triggered), enter data at C1, enter (event triggers here)
"Frank Kabel" wrote:

Hi
you could check with
if not intersect(target,me.range("1:1")) is nothing then
msgbox "change in row 1"
end if

--
Regards
Frank Kabel
Frankfurt, Germany

"crazybass2" schrieb im
Newsbeitrag

...
I've already got a worksheet_change event in my code. How

would
I
check if
the row has changed since the last entry?

"Frank Kabel" wrote:

Hi
you would use also the worksheet_change event and check if

anything
within your row is changed.

--
Regards
Frank Kabel
Frankfurt, Germany

"crazybass2" schrieb

im
Newsbeitrag
...
I want to trigger an event when the row is changed as

opposed
to
a
cell. How
would I do this?

i.e.

I'm on row 12. I make a change to the B column, then tab

to
the
C
column.
After entering data in C, I tab over to F and enter more

data. I
don't want
the event to trigger until I click another row or hit the

Enter
key.