Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Disable item in combobox

Hi,

Is it possible in a combox to disable one item so the user see the item but
does not can select the item??

Thanks


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Disable item in combobox

Hi Peter

Out of interest, why do you want to do this? I don't know of a way of doing
this exactly but you could check the chosen value and reject it if it's the
wrong one.

For example, assume combobox1 has three values "Tom", "Dick", "Harry" and
that you don't want the user to be able to choose "Dick"

Private Sub ComboBox1_Change()
If (ComboBox1.Value = "Dick") Then
MsgBox ("Dick is not a valid selection")
ComboBox1.ListIndex = -1
End If
End Sub

This way the user can choose any value (including Dick) buts gets shown a
message when Dick's chosen saying "not valid" and the listindex is set to -1
(i.e. no item chosen)

Hope this helps

David



"Peter Pantus" wrote in message
l...
Hi,

Is it possible in a combox to disable one item so the user see the item

but
does not can select the item??

Thanks




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Disable item in combobox

Thanks David
That is exaclty what I want
It is too complicate too explane why I want to do this


"David Coleman" schreef in bericht
...
Hi Peter

Out of interest, why do you want to do this? I don't know of a way of

doing
this exactly but you could check the chosen value and reject it if it's

the
wrong one.

For example, assume combobox1 has three values "Tom", "Dick", "Harry" and
that you don't want the user to be able to choose "Dick"

Private Sub ComboBox1_Change()
If (ComboBox1.Value = "Dick") Then
MsgBox ("Dick is not a valid selection")
ComboBox1.ListIndex = -1
End If
End Sub

This way the user can choose any value (including Dick) buts gets shown a
message when Dick's chosen saying "not valid" and the listindex is set

to -1
(i.e. no item chosen)

Hope this helps

David



"Peter Pantus" wrote in message
l...
Hi,

Is it possible in a combox to disable one item so the user see the item

but
does not can select the item??

Thanks






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
Use match function to add different item in Combobox Leonard Lan Excel Worksheet Functions 2 September 9th 09 06:26 PM
Disable and enable dropdown combobox(Form Control) Vinod[_2_] Excel Discussion (Misc queries) 0 November 6th 07 07:30 PM
item limit for a combobox? KarenH Excel Worksheet Functions 3 July 20th 06 09:30 PM
Disable an item in a list Martin Excel Discussion (Misc queries) 2 October 18th 05 08:40 PM
ComboBox and select item Soniya Excel Programming 5 August 23rd 03 11:18 AM


All times are GMT +1. The time now is 04:13 AM.

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

About Us

"It's about Microsoft Excel"