Quick Question

Noz2k

Well-known Member
Joined
Mar 15, 2011
Messages
688
You know the little yellow boxes that often come up when you hover over a textbox with a mouse to give some kind of prompt to the user. What are they called and how do you reference them in VBA?
 

Some videos you may like

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type

JamesW

Well-known Member
Joined
Oct 30, 2009
Messages
1,197
Hi,

Do you mean comments?

If so, maybe these will help:

Code:
    Range("A1").AddComment
    Range("A1").Comment.Text Text:="text"

If not, then ignore me ;)
 

SuperFerret

Well-known Member
Joined
Mar 2, 2009
Messages
515
...maybe Data Validation - Input Messages?

Don't know how you would reference in VBA if it's those though
 

Noz2k

Well-known Member
Joined
Mar 15, 2011
Messages
688
erm not sure.

This would be on a Userform as oppose to in a worksheet though. Is it still the same thing?

I want for example when somebody hovers the mouse over my Date textbox it to come up in little box saying "dd/mm/yyyy"
 

Noz2k

Well-known Member
Joined
Mar 15, 2011
Messages
688

ADVERTISEMENT

...maybe Data Validation - Input Messages?

Don't know how you would reference in VBA if it's those though

Yes, Input messages, that's the one. But need to reference it in VBA
 

SuperFerret

Well-known Member
Joined
Mar 2, 2009
Messages
515
Code:
Sub Validation_by_VBA() 
Range("A2").Select 
With Selection.Validation 
.Delete 
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _ 
xlBetween, Formula1:="value1;value2;value3" 
.IgnoreBlank = True 
.InCellDropdown = True 
.InputTitle = "" 
.ErrorTitle = "" 
[COLOR=red].InputMessage = "" 
[/COLOR].ErrorMessage = "" 
.ShowInput = True 
.ShowError = True 
End With 
End Sub

Found this after a quick search on Google, if this helps... ;)
 

Noz2k

Well-known Member
Joined
Mar 15, 2011
Messages
688

ADVERTISEMENT

It may be something along those lines, but it's for textboxes/comboboxes in a userform, so I don't think .Select works?

Essentially I think this could be done by creating lots of textboxes and toggling their visibility, but was hoping there was a little bit more of a built in feature than that. One that would show the little prompt message at the bottom of the cursor icon or something along those lines.
 

Noz2k

Well-known Member
Joined
Mar 15, 2011
Messages
688
Ok so I probably explained this really poorly. Just found the solution and it's very simple. Am unsure what the code for it is. But all I had to do is add the text I wanted to the control tip text element in the properties window for textbox.

Thanks for your help anyway
 

Watch MrExcel Video

Forum statistics

Threads
1,109,042
Messages
5,526,420
Members
409,701
Latest member
nitmani

This Week's Hot Topics

Top