- Goto Developers Tab.
- Click on "Insert"
- Select Button (Form Control)
- Right Click on the button created and select "Assign Macro"
- Give the Macro Name and select OK.
- Then add the following Macro code:
Private Sub CommandButton2_Click()Dim c As ControlDim a As ControlFor Each c In UserForm1.ControlsIf TypeName(c) = "TextBox" Thenc.Value = ""End IfNext cUserForm1.TextBox1.SetFocusFor Each a In UserForm1.ControlsIf TypeName(a) = "ComboBox" Thena.Value = ""End IfNext aUserForm1.TextBox1.SetFocusEnd Sub
No comments:
Post a Comment
Thank You.
https://linwintech.blogspot.com/