ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   drodown selection (https://www.excelbanter.com/excel-programming/415801-drodown-selection.html)

geebee

drodown selection
 
hi,

i have some code on dropdown change... but noticed that it really doesnt
execute when there is only one value available for selection. like it works
if you have more than one value to be selected, but if there is only one, it
really doesnt trigger anything...

any ideas?

thanks in advance,
geebee


Otto Moehrbach[_2_]

drodown selection
 
You are probably using a Worksheet_Change event macro. Such a macro fires
only if the contents of a cell change. If your drop-down has only one
value, then selecting that one value will not change the contents of the
cell and the macro will not fire. Perhaps a Worksheet_SelectionChange macro
will work for you. HTH Otto
"geebee" (noSPAMs) wrote in message
...
hi,

i have some code on dropdown change... but noticed that it really doesnt
execute when there is only one value available for selection. like it
works
if you have more than one value to be selected, but if there is only one,
it
really doesnt trigger anything...

any ideas?

thanks in advance,
geebee




Gary''s Student

drodown selection
 
The macro:

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("A1")) Is Nothing Then Exit Sub
MsgBox (Target.Value)
End Sub

seems to trap changes to cell A1
even via Data Validation
even if the Validation List is only one item
even if the Validation entry does not actually change the cell
value
--
Gary''s Student - gsnu200800


"geebee" wrote:

hi,

i have some code on dropdown change... but noticed that it really doesnt
execute when there is only one value available for selection. like it works
if you have more than one value to be selected, but if there is only one, it
really doesnt trigger anything...

any ideas?

thanks in advance,
geebee


RyanH

drodown selection
 
If you only have 1 selection in the DropDown Box (ListIndex = 0) then there
is no way to change the ListIndex, thus will not fire the Change_Event.

Maybe you could try the AfterUpdate_Event in your application.

Hope this helps.
--
Cheers,
Ryan


"geebee" wrote:

hi,

i have some code on dropdown change... but noticed that it really doesnt
execute when there is only one value available for selection. like it works
if you have more than one value to be selected, but if there is only one, it
really doesnt trigger anything...

any ideas?

thanks in advance,
geebee



All times are GMT +1. The time now is 05:11 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com