I
Internetdomainowner
I'm having a difficult time trying to find out how to get this code to
work... I'm hoping someone can help!!! What I am trying to do is the
following...
When the mouse moves on a userform it gets the name of the control is
hovering over... there is one thing though... I've given the userform
the ability to add buttons by it's self using code... my code is
below. Thanks to anyone who can help, if you get me a working solution
I'll tip ya via PayPal.
Private Sub CommandButton10_Click()
Set mycmd = Controls.Add("Forms.CommandButton.1",
UserForm1.Textbox1.Value, True)
mycmd.Caption = UserForm1.Spreadsheet1.ActiveCell.Value
mycmd.Left = 100
mycmd.Top = 20
mycmd.Picture = UserForm1.TextBox2.Value
mycmd.AutoSize = True
mycmd.Visible = True
Set mycmd = Nothing
End Sub
Private Sub UserForm_MouseMove(ByVal Button As Integer, ByVal Shift As
Integer, ByVal X As Single, ByVal Y As Single)
Dim cCont As Control
'Table2 is the text entered in TextBox1 from above
If UserForm1.cCont.Name = "Table2" Then
UserForm1.TextBox6.Value = cCont.Name
End If
End Sub
I'm then looking to refrence the value brought back in another
macro...
Private Sub TextBox6_Change()
If UserForm1.TextBox6.Value = "Table2" Then
UserForm3.Show
MsgBox "It's been done"
End If
End Sub
Thanks!!!
work... I'm hoping someone can help!!! What I am trying to do is the
following...
When the mouse moves on a userform it gets the name of the control is
hovering over... there is one thing though... I've given the userform
the ability to add buttons by it's self using code... my code is
below. Thanks to anyone who can help, if you get me a working solution
I'll tip ya via PayPal.
Private Sub CommandButton10_Click()
Set mycmd = Controls.Add("Forms.CommandButton.1",
UserForm1.Textbox1.Value, True)
mycmd.Caption = UserForm1.Spreadsheet1.ActiveCell.Value
mycmd.Left = 100
mycmd.Top = 20
mycmd.Picture = UserForm1.TextBox2.Value
mycmd.AutoSize = True
mycmd.Visible = True
Set mycmd = Nothing
End Sub
Private Sub UserForm_MouseMove(ByVal Button As Integer, ByVal Shift As
Integer, ByVal X As Single, ByVal Y As Single)
Dim cCont As Control
'Table2 is the text entered in TextBox1 from above
If UserForm1.cCont.Name = "Table2" Then
UserForm1.TextBox6.Value = cCont.Name
End If
End Sub
I'm then looking to refrence the value brought back in another
macro...
Private Sub TextBox6_Change()
If UserForm1.TextBox6.Value = "Table2" Then
UserForm3.Show
MsgBox "It's been done"
End If
End Sub
Thanks!!!