If you really have two command buttons and one is named "CommandButton1" and the other is named "CommandButton2" then place the following code in your workbook's VBE as instructed below.
If you are saying you have 2 command buttons but really you have more than that, you should use a class module instead of a bunch of individual MouseMove events and a stacked Case structure in the Function.
Taking your question literally, considering that you have two embedded activex command buttons, delete the entire code from both modules that I posted before, so you don't get an ambiguous compile error.
Then...
This in a standard module:
Option Explicit
Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long
Declare Function GetSysColor Lib "user32" (ByVal nIndex As Long) As Long
Public strCaption$
Public WhichButton$
Public Function CreateToolTipLabel(objHostOLE As Object, strCaption As String) As Boolean
Application.ScreenUpdating = False
Dim objToolTipLbl As OLEObject, objOLE As OLEObject
Const SM_CXSCREEN = 0
Const COLOR_INFOTEXT = 23
Const COLOR_INFOBK = 24
Const COLOR_WINDOWFRAME = 6
For Each objOLE In ActiveSheet.OLEObjects
If objOLE.Name = "lblToolTip" Then objOLE.Delete
Next objOLE
Set objToolTipLbl = ActiveSheet.OLEObjects.Add(ClassType:="Forms.Label.1")
Select Case WhichButton
Case "CommandButton1"
strCaption = "This is my tooltip text for CommandButton1."
Case "CommandButton2"
strCaption = "This is my tooltip text for CommandButton2."
Case ""
strCaption = "Tooltip text looking for a home."
End Select
With objToolTipLbl
.Top = objHostOLE.Top + objHostOLE.Height - 10
.Left = objHostOLE.Left + objHostOLE.Width - 10
.Object.Caption = strCaption
.Object.Font.Size = 10
.Object.BackColor = GetSysColor(COLOR_INFOBK)
.Object.BackStyle = 1
.Object.BorderColor = GetSysColor(COLOR_WINDOWFRAME)
.Object.BorderStyle = 1
.Object.ForeColor = GetSysColor(COLOR_INFOTEXT)
.Object.TextAlign = 1
.Object.AutoSize = False
.Width = GetSystemMetrics(SM_CXSCREEN)
.Object.AutoSize = True
.Width = .Width + 2
.Height = .Height + 2
.Name = "lblToolTip"
End With
DoEvents
Application.ScreenUpdating = True
Application.OnTime Now() + TimeValue("00:00:03"), "DeleteToolTipLabels"
End Function
Public Sub DeleteToolTipLabels()
Dim objToolTipLbl As OLEObject
For Each objToolTipLbl In ActiveSheet.OLEObjects
If objToolTipLbl.Name = "lblToolTip" Then objToolTipLbl.Delete
Next objToolTipLbl
End Sub
This in the worksheet module:
Option Explicit
Private Sub CommandButton1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
WhichButton = "CommandButton1"
Dim myToolTip As OLEObject, blnToolTip As Boolean
For Each myToolTip In ActiveSheet.OLEObjects
blnToolTip = myToolTip.Name = "lblToolTip"
Next myToolTip
If Not blnToolTip Then
CreateToolTipLabel CommandButton1, strCaption
End If
End Sub
Private Sub CommandButton2_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
WhichButton = "CommandButton2"
Dim myToolTip As OLEObject, blnToolTip As Boolean
For Each myToolTip In ActiveSheet.OLEObjects
blnToolTip = myToolTip.Name = "lblToolTip"
Next myToolTip
If Not blnToolTip Then
CreateToolTipLabel CommandButton2, strCaption
End If
End Sub