Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello
I've created a cell that has a validation list associated to it. Which Event can I use so that it will run that event when and only when that validation range is modified Currently I've have the macro in the sheet_change section but this mean that it run whenever any change occurs on the sheet and this is useless. I only need it to run if the selection from the validation range change Thank you for your help Daniel |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Daniel
use the worksheet change event and restrict the range it should process. e.g. Private Sub Worksheet_Change(ByVal Target As Range) If Target.Cells.Count 1 Then Exit Sub If Intersect(Target, Me.Range("A1:A10")) Is Nothing Then Exit Sub 'your code End Sub your code is only processed if a single cell in the range A1:A10 is changed -- Regards Frank Kabel Frankfurt, Germany Daniel P wrote: Hello, I've created a cell that has a validation list associated to it. Which Event can I use so that it will run that event when and only when that validation range is modified? Currently I've have the macro in the sheet_change section but this mean that it run whenever any change occurs on the sheet and this is useless. I only need it to run if the selection from the validation range changes Thank you for your help, Daniel |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If Target.Cells.Count 1 Then Exit Sub
So, Frank, if the user selects 2 or more cells in the validation range and makes a (Ctrl-Enter) change the validation routine is bypassed?<g -- Jim Rech Excel MVP |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Jim
yes, as I wrote :-) ....if a SINGLE cell in .... But you're right the OP should probably delete this line -- Regards Frank Kabel Frankfurt, Germany Jim Rech wrote: If Target.Cells.Count 1 Then Exit Sub So, Frank, if the user selects 2 or more cells in the validation range and makes a (Ctrl-Enter) change the validation routine is bypassed?<g |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
event vba | Excel Worksheet Functions | |||
VBA Event | Excel Discussion (Misc queries) | |||
event | Excel Discussion (Misc queries) | |||
change event/after update event?? | Excel Programming | |||
OnTime event not firing in Workbook_Open event procedure | Excel Programming |