Resetting cells

  • Thread starter Thread starter Sony
  • Start date Start date
S

Sony

I want to be able to clear all the fields that are being
populated by a userform with a command button. Can this
be done?
 
Insert an event in your user form for the reset button (I have named it
Reset)
Yuo need to set the userform controls to an appropriate value eg Textbox
with the reset value, checkboxes, options buttons to true or false, whatever
you deem as the reset state.

Private Sub Reset_Click()
TextBox1.Value = ""
CheckBox1.Value = False
OptionButton1.Value = False
End Sub

Cheers
Nigel
 
Thank you Nigel.
-----Original Message-----
Insert an event in your user form for the reset button (I have named it
Reset)
Yuo need to set the userform controls to an appropriate value eg Textbox
with the reset value, checkboxes, options buttons to true or false, whatever
you deem as the reset state.

Private Sub Reset_Click()
TextBox1.Value = ""
CheckBox1.Value = False
OptionButton1.Value = False
End Sub

Cheers
Nigel






----== Posted via Newsfeed.Com - Unlimited-Uncensored- Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
.
 
Not in its current format, the click event resulting currently clears the
form control values only, however you can use the same event to clear
entries in sheet cells. In its simplest form use

for a sinlge cell on a worksheet
Worksheets("sheet1").Range("A1").Value = ""

or for multiple cells in a column
Worksheets("sheet1").Range("A1:A10").Value = ""

or for an area
Worksheets("sheet1").Range("A1:C10").Value = ""

Cheers
Nigel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top