Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I am using the worksheet change event to run code when the value in a cell in Column C is changed.. If Not Application.Intersect(Target, Me.Range("c2:c65536")) Is Nothing Then If Me.Cells(Selection.Row, 3).Value < "" Then Do this..... End If End If The code runs if Enter key is pressed but will not run if the down arrow key is pressed. What can I do to make the code run when the arrow key is pressed? Thanks in advance for the help. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The worksheet_change event will fire if you make a change. Using the arrow key
to travel down the column isn't making changes to the worksheet. If you're trying to fix something that's already been entered, maybe using a dedicated macro (run it once to fix the existing data) would be better. ps. instead of using selection.row, I'd use target.row. But since you're using the 3rd column, isn't: me.cells(target.row,3).value the same as Target.value (assuming a single cell was changed) Raj wrote: Hi, I am using the worksheet change event to run code when the value in a cell in Column C is changed.. If Not Application.Intersect(Target, Me.Range("c2:c65536")) Is Nothing Then If Me.Cells(Selection.Row, 3).Value < "" Then Do this..... End If End If The code runs if Enter key is pressed but will not run if the down arrow key is pressed. What can I do to make the code run when the arrow key is pressed? Thanks in advance for the help. -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It works either way for me. When you press the down arrow- key, does the
active cell drop down? I'm thinking maybe you are using the down-arrow key in the number pad (right side of the keyboard) with NumLock on. HTH Otto "Raj" wrote in message ... Hi, I am using the worksheet change event to run code when the value in a cell in Column C is changed.. If Not Application.Intersect(Target, Me.Range("c2:c65536")) Is Nothing Then If Me.Cells(Selection.Row, 3).Value < "" Then Do this..... End If End If The code runs if Enter key is pressed but will not run if the down arrow key is pressed. What can I do to make the code run when the arrow key is pressed? Thanks in advance for the help. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Have you tried using the Worksheet_Selection change event? Also, I'd change
"C2:C65536" to "C2:C"& me.rows.count in the line below. if Not Application.Intersect(Target, Me.Range("c2:c65536")) Is Nothing I'm guessing your code was written for Excel 2003. HTH, Barb Reinhardt "Raj" wrote: Hi, I am using the worksheet change event to run code when the value in a cell in Column C is changed.. If Not Application.Intersect(Target, Me.Range("c2:c65536")) Is Nothing Then If Me.Cells(Selection.Row, 3).Value < "" Then Do this..... End If End If The code runs if Enter key is pressed but will not run if the down arrow key is pressed. What can I do to make the code run when the arrow key is pressed? Thanks in advance for the help. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
worksheet change event running slow | Excel Programming | |||
Worksheet Change event not running a macro | Excel Programming | |||
combobox change event is running when enable events is false | Excel Programming | |||
Workbook_BeforeClose change event not running correctly | Excel Programming |