Add this to the declarations section in the userform:
and then refer to Button wherever you need it in the code.![]()
Public Button As MSForms.CommandButton
The ShowDialog code becomes:
and the button_click:![]()
Sub ShowDialog(btn As MSForms.CommandButton) Dim frm As UserForm1 Set frm = New UserForm1 Set frm.Button = btn frm.Show End Sub
![]()
Private Sub CommandButton7_Click() ScreenUpdating = False ShowDialog CommandButton7 End Sub
Bookmarks