Quick Question

Noz2k

Well-known Member
Joined
Mar 15, 2011
Messages
693
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?
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
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 ;)
 
Upvote 0
...maybe Data Validation - Input Messages?

Don't know how you would reference in VBA if it's those though
 
Upvote 0
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"
 
Upvote 0
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... ;)
 
Upvote 0
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.
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,214,821
Messages
6,121,759
Members
449,048
Latest member
excelknuckles

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
Back
Top