Hello my friends
I have a form that contains these buttons
I want the form to open and to click on each of the buttons, put its caption in the cell
I tested the following code
And I get the following error,
"object variable or with block variable not set"
code of button
what is the reason?
I have a form that contains these buttons
I want the form to open and to click on each of the buttons, put its caption in the cell
I tested the following code
VBA Code:
' Function to edit the value in column B for a given cell.
Sub EditValue(cell)
' Initialize the UserForm1 object
Dim UserForm1 As UserForm1
Set UserForm1 = New UserForm1
UserForm1.Show
Set UserForm1 = Nothing
cell.Offset(0, 1).Value = UserForm1.ActiveControl.Caption
End Sub
And I get the following error,
"object variable or with block variable not set"
code of button
VBA Code:
Private Sub CommandButton1_Click()
Unload Me
End Sub
what is the reason?