|
-
Jan 20th, 2006, 04:49 AM
#1
Thread Starter
Member
A VBA Question (Tooltip)
Hi
How can I add Tool tip text to a text box which I have added to my Excel sheet?
Thnx in advance.
Regards
a_k93
when u get an error, means u r code getting executed
-
Jan 20th, 2006, 06:20 AM
#2
Re: A VBA Question (Tooltip)
Moved to Office Development
-
Jan 20th, 2006, 08:22 AM
#3
Re: A VBA Question (Tooltip)
No easy way but you would want to use the MouseMove event to determine when the mouse is over the textbox.
I know there are a few good tooltip examples in the CodeBank but I have never tried using them on an Excel ccontrol.
Which textbox is it? A Forms or ActiveX Textbox?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 20th, 2006, 09:58 AM
#4
Thread Starter
Member
Re: A VBA Question (Tooltip)
Hi there,
Thnx for your reply,
I am newbie for excel VBA. I have right click on the toolbar and selected Control Toolbox. which then gave me n nos of control. Then I have dragged and drop the controls on the excel sheet.
Can I ask u more thing.
I have around 100 textboxes and 15 combo box and 5 check box on a sheet and around 125 labels and likewise I have 5 sheets. Now I am on particular sheet I want to clear all the textboxes from that sheet.
Like in VB6 v write
Dim ctrl As Object
For Each ctrl In Me.Controls
Debug.Print ctrl.Name
Next
How do I do the same for Excel controls which I have in my all sheets.
Once again, thnx for your reply,
Regards,
a_k93
when u get an error, means u r code getting executed
-
Jan 20th, 2006, 10:11 AM
#5
Re: A VBA Question (Tooltip)
Check out the InlineShapes or OLEObjects collections.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 23rd, 2006, 09:39 AM
#6
Thread Starter
Member
Re: A VBA Question (Tooltip)
Hi there,
Thanx for u r help Rob.
I was looking for the code which will set the properties of all the controls placed on the sheet.
The code below does the same.
I have written the generic method in the module
Public Sub Clear_ctrl(strShetName As String)
Dim objWs
Dim objShape
Set objWs = Worksheets(strShetName)
For Each objShape In objWs.Shapes
If objShape.Type = msoOLEControlObject Then
If objShape.OLEFormat.ProgId = "Forms.CheckBox.1" Then
objWs.OLEObjects(objShape.Name).Object.Value = 0
End If
If objShape.OLEFormat.ProgId = "Forms.TextBox.1" Then
objWs.OLEObjects(objShape.Name).Object.Text = ""
End If
If objShape.OLEFormat.ProgId = "Forms.ComboBox.1" Then
objWs.OLEObjects(objShape.Name).Object.Text = ""
End If
If objShape.OLEFormat.ProgId = "Forms.OptionButton.1" Then
objWs.OLEObjects(objShape.Name).Object.Value = 1
End If
End If
Next
End Sub
Thanx for u r support.
Rob, can u elaborate little bit more on the Tooltip point, like how should I go about when I move the mouse over any textbox which needs to show the tooltip, do I need to call any api or anything like ....
Thanx
a_k93
when u get an error, means u r code getting executed
-
Jan 23rd, 2006, 09:56 AM
#7
Re: A VBA Question (Tooltip)
Use the MouseMove event for each of the controls. It fires when the mouse moves over the control.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|