Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Cell validation

I use a data validation to fill a cell from a list. This doesn't appear to
trigger a cell.value change event however like typing into the cell does. Is
there a way around this?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Cell validation

In xl2000 and later it does. In Excel 97, it will if you have a hand
entered list. If not, the best you can do is have a formula refer to that
cell and react in the calculate event - however, it is not limited to
changes in that cell.

--
Regards,
Tom Ogilvy

"myleslawrence" wrote in message
...
I use a data validation to fill a cell from a list. This doesn't appear to
trigger a cell.value change event however like typing into the cell does.

Is
there a way around this?




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Cell validation

I use this to determine if a cell has changed:
if Not Application.Intersect(ActiveCell,Range("F6:F22")) is Nothing then
KeyCellsChanged

KeyCellsCahanged never gets called when I use the cell validate to populate
the cell but works fine if I type a value into the cell.
Am I doing something wrong?


"Tom Ogilvy" wrote in message
...
In xl2000 and later it does. In Excel 97, it will if you have a hand
entered list. If not, the best you can do is have a formula refer to
that
cell and react in the calculate event - however, it is not limited to
changes in that cell.

--
Regards,
Tom Ogilvy

"myleslawrence" wrote in message
...
I use a data validation to fill a cell from a list. This doesn't appear
to
trigger a cell.value change event however like typing into the cell does.

Is
there a way around this?






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Cell validation

Hi Myles,

What version of Excel are you using?

As Tom pointed out, in versions after xl97 data validation does trigger a
change event.

if Not Application.Intersect(ActiveCell,Range("F6:F22")) is Nothing then
KeyCellsChanged


In this event code you would be advised to use Target rather than
ActiveCell, the two are not synonymous. As a simple example, in the above
code, add a
MsgBox "Changed!"
make an entry in cell F5 and confirm with the Enter key.


---
Regards,
Norman



"myleslawrence" wrote in message
...
I use this to determine if a cell has changed:
if Not Application.Intersect(ActiveCell,Range("F6:F22")) is Nothing then
KeyCellsChanged

KeyCellsCahanged never gets called when I use the cell validate to
populate the cell but works fine if I type a value into the cell.
Am I doing something wrong?


"Tom Ogilvy" wrote in message
...
In xl2000 and later it does. In Excel 97, it will if you have a hand
entered list. If not, the best you can do is have a formula refer to
that
cell and react in the calculate event - however, it is not limited to
changes in that cell.

--
Regards,
Tom Ogilvy

"myleslawrence" wrote in message
...
I use a data validation to fill a cell from a list. This doesn't appear
to
trigger a cell.value change event however like typing into the cell
does.

Is
there a way around this?








  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Cell validation

Thanks Norman but I guess I'm not following you. Replace the variable
ActiveCell with Target? This generates an error.
"Norman Jones" wrote in message
...
Hi Myles,

What version of Excel are you using?

As Tom pointed out, in versions after xl97 data validation does trigger a
change event.

if Not Application.Intersect(ActiveCell,Range("F6:F22")) is Nothing then
KeyCellsChanged


In this event code you would be advised to use Target rather than
ActiveCell, the two are not synonymous. As a simple example, in the above
code, add a
MsgBox "Changed!"
make an entry in cell F5 and confirm with the Enter key.


---
Regards,
Norman



"myleslawrence" wrote in message
...
I use this to determine if a cell has changed:
if Not Application.Intersect(ActiveCell,Range("F6:F22")) is Nothing then
KeyCellsChanged

KeyCellsCahanged never gets called when I use the cell validate to
populate the cell but works fine if I type a value into the cell.
Am I doing something wrong?


"Tom Ogilvy" wrote in message
...
In xl2000 and later it does. In Excel 97, it will if you have a hand
entered list. If not, the best you can do is have a formula refer to
that
cell and react in the calculate event - however, it is not limited to
changes in that cell.

--
Regards,
Tom Ogilvy

"myleslawrence" wrote in message
...
I use a data validation to fill a cell from a list. This doesn't appear
to
trigger a cell.value change event however like typing into the cell
does.
Is
there a way around this?












  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Cell validation

Norman is assuming you are using the Change event


Private Sub Worksheet_Change(ByVal Target As Range)
if Not Application.Intersect(Target,Range("F6:F22")) is Nothing then
msgbox "Change is in the range "F6:F22")
End if
End Sub

Placed in the module of the worksheet where you want this behavior (right
click on the sheet tab, select view code).

--
Regards,
Tom Ogilvy

"myleslawrence" wrote in message
...
Thanks Norman but I guess I'm not following you. Replace the variable
ActiveCell with Target? This generates an error.
"Norman Jones" wrote in message
...
Hi Myles,

What version of Excel are you using?

As Tom pointed out, in versions after xl97 data validation does trigger

a
change event.

if Not Application.Intersect(ActiveCell,Range("F6:F22")) is Nothing

then
KeyCellsChanged


In this event code you would be advised to use Target rather than
ActiveCell, the two are not synonymous. As a simple example, in the

above
code, add a
MsgBox "Changed!"
make an entry in cell F5 and confirm with the Enter key.


---
Regards,
Norman



"myleslawrence" wrote in message
...
I use this to determine if a cell has changed:
if Not Application.Intersect(ActiveCell,Range("F6:F22")) is Nothing

then
KeyCellsChanged

KeyCellsCahanged never gets called when I use the cell validate to
populate the cell but works fine if I type a value into the cell.
Am I doing something wrong?


"Tom Ogilvy" wrote in message
...
In xl2000 and later it does. In Excel 97, it will if you have a hand
entered list. If not, the best you can do is have a formula refer to
that
cell and react in the calculate event - however, it is not limited to
changes in that cell.

--
Regards,
Tom Ogilvy

"myleslawrence" wrote in message
...
I use a data validation to fill a cell from a list. This doesn't

appear
to
trigger a cell.value change event however like typing into the cell
does.
Is
there a way around this?












  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Cell validation

Never mind, I got it and thanks very much.
"Norman Jones" wrote in message
...
Hi Myles,

What version of Excel are you using?

As Tom pointed out, in versions after xl97 data validation does trigger a
change event.

if Not Application.Intersect(ActiveCell,Range("F6:F22")) is Nothing then
KeyCellsChanged


In this event code you would be advised to use Target rather than
ActiveCell, the two are not synonymous. As a simple example, in the above
code, add a
MsgBox "Changed!"
make an entry in cell F5 and confirm with the Enter key.


---
Regards,
Norman



"myleslawrence" wrote in message
...
I use this to determine if a cell has changed:
if Not Application.Intersect(ActiveCell,Range("F6:F22")) is Nothing then
KeyCellsChanged

KeyCellsCahanged never gets called when I use the cell validate to
populate the cell but works fine if I type a value into the cell.
Am I doing something wrong?


"Tom Ogilvy" wrote in message
...
In xl2000 and later it does. In Excel 97, it will if you have a hand
entered list. If not, the best you can do is have a formula refer to
that
cell and react in the calculate event - however, it is not limited to
changes in that cell.

--
Regards,
Tom Ogilvy

"myleslawrence" wrote in message
...
I use a data validation to fill a cell from a list. This doesn't appear
to
trigger a cell.value change event however like typing into the cell
does.
Is
there a way around this?










Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Validation Data using Validation Table cell range..... Dermot Excel Discussion (Misc queries) 16 January 5th 10 09:35 PM
how blank data validation cell after changing dependent cell? Ian Elliott Excel Discussion (Misc queries) 5 August 16th 09 02:42 AM
Force entry into cell, based on validation selection in adjacent cell Richhall[_2_] Excel Worksheet Functions 3 June 18th 09 10:28 AM
Selecting a cell entry based on cell validation selection Brutalius Excel Worksheet Functions 2 December 17th 08 03:44 AM
Dynamically adding an in-cell drop-down list (i.e. Validation Object) to a cell? debartsa Excel Programming 5 March 5th 04 08:45 AM


All times are GMT +1. The time now is 02:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"