Combo Box (ControlTipText)

adambc

Board Regular
Joined
Jan 13, 2020
Messages
155
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
ControlTipText appears when the User hovers over the Combo Box ...

Is there anyway of displaying this text in grey in the Combo Box?

Similar to the way in which many online forms do.

Thanks ...
 

Some videos you may like

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

Yongle

Well-known Member
Joined
Mar 11, 2015
Messages
6,977
Office Version
  1. 365
Platform
  1. Windows
Is the combobox in a userform? Consider this option
Insert a label above the combobox (Label1)
Paste controltip text into Label1 and amend Label1 properties to render the text grey
Make Label1 non-visible until user hovers over the combobox
Leave Label1 visible whilst the mouse is over the combobox

Example code
VBA Code:
Private Sub UserForm_Initialize()
    ShowLabel False
End Sub
Private Sub UserForm_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
    ShowLabel False
End Sub
Private Sub ComboBox1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
    ShowLabel True
End Sub
Private Sub ShowLabel(X As Boolean)
    Label1.Visible = X
End Sub
 

adambc

Board Regular
Joined
Jan 13, 2020
Messages
155
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
Thanks, but that doesn’t give me much/any more than simply adding the text to the ControlTipText Combo Box property ...

What I was hoping for is for the text to be visible in the Combo Box When the UserForm loads ...

My text is “Select From List or Enter Manual Value” (or words to that effect (the Combo Box property is set to allow a manual entry) ...

Any more ideas anyone?

Thanks ...
 

Yongle

Well-known Member
Joined
Mar 11, 2015
Messages
6,977
Office Version
  1. 365
Platform
  1. Windows
What I was hoping for is for the text to be visible in the Combo Box When the UserForm loads ...
in which case ....
VBA Code:
Private Sub UserForm_Initialize()
    ShowLabel True
End Sub
 

Yongle

Well-known Member
Joined
Mar 11, 2015
Messages
6,977
Office Version
  1. 365
Platform
  1. Windows
Another idea

VBA Code:
Private Sub UserForm_Initialize()
    ComboBox1.Value = ComboBox1.ControlTipText
End Sub

Private Sub ComboBox1_DropButtonClick()
    ComboBox1.Value = ""
End Sub
 

Yongle

Well-known Member
Joined
Mar 11, 2015
Messages
6,977
Office Version
  1. 365
Platform
  1. Windows
Or you could use a label and place it above the combo box so that the text appears to be inside the box
(format it as preferred)

The text disappears when anything is selected or entered manually

VBA Code:
Private Sub UserForm_Initialize()
    Label1.Caption = ComboBox1.ControlTipText
End Sub
Private Sub ComboBox1_Change()
    Label1.Visible = False
End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,122,312
Messages
5,595,427
Members
413,990
Latest member
Kher83

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top