View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
ryguy7272 ryguy7272 is offline
external usenet poster
 
Posts: 2,836
Default clicking cancle button still populates radio buttons, check box in


Maybe this:
UserForm1.Hide
UserForm2.Show
'etc.

Or this:
Unload UserForm1
'etc.


This will clear all TextBoxes on a Form:
Private Sub cmdNew_Click()
Dim C As MSForms.Control
For Each C In Me.Controls
If TypeOf C Is MSForms.TextBox Then
C.Text = ""
End If
Next C
End Sub

HTH,
Ryan---

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"sam" wrote:

Hi all,

I have designed an excel form with Three buttons Cancle, Clear and Submit

The issue: When I input the data and click Cancle button, The form still
populates the excel sheet with inputs in radio buttons and checkboxes but not
the text box inputs. The code for my cancle button is

Private Sub Cancel_Click()
Unload Me
End Sub

Shouldnt it unload data from all the fields?

Please HELP

Thanks in Advance.