Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 137
Default Reset userform

Is there some simple short code to clear all entries from a userform?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Reset userform

If you are talking about clearing text boxes, use code like the
following:

Dim C As MSForms.Control
For Each C In Me.Controls
If TypeOf C Is MSForms.TextBox Then
C.Text = ""
End If
Next C


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Newbie" wrote in message
...
Is there some simple short code to clear all entries from a

userform?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Reset userform

unload Userform1
Userform1.Show

--
Regards,
Tom Ogilvy


"Newbie" wrote in message
...
Is there some simple short code to clear all entries from a userform?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 469
Default Reset userform

useing option button in userform. Userform goes to sheet and hides. Upon
recall there is a dot in front round window of last action. When this is in
window it disables use of option button. Seems that the userform remembers
last action. Can this last action be disabled thru properties? Or does it
need to be done with code. If code how.
Thanks You

"Chip Pearson" wrote:

If you are talking about clearing text boxes, use code like the
following:

Dim C As MSForms.Control
For Each C In Me.Controls
If TypeOf C Is MSForms.TextBox Then
C.Text = ""
End If
Next C


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Newbie" wrote in message
...
Is there some simple short code to clear all entries from a

userform?



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Reset userform

Curt,
If you are only hiding the userform, then all its properties remain
unchanged. But adapting Chip's code slightly for the Option button, to set
them all to False:

Dim C As MSForms.Control

For Each C In Me.Controls
If TypeOf C Is MSForms.OptionButton Then
C.Value = False
End If
Next C

NickHK

"Curt" wrote in message
...
useing option button in userform. Userform goes to sheet and hides. Upon
recall there is a dot in front round window of last action. When this is

in
window it disables use of option button. Seems that the userform remembers
last action. Can this last action be disabled thru properties? Or does it
need to be done with code. If code how.
Thanks You

"Chip Pearson" wrote:

If you are talking about clearing text boxes, use code like the
following:

Dim C As MSForms.Control
For Each C In Me.Controls
If TypeOf C Is MSForms.TextBox Then
C.Text = ""
End If
Next C


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Newbie" wrote in message
...
Is there some simple short code to clear all entries from a

userform?





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tab Key reset DKSteph Excel Worksheet Functions 2 March 20th 09 07:20 PM
How do I reset the tab key? Saeanen Excel Discussion (Misc queries) 2 May 22nd 07 04:26 PM
reset to zero baldyheed Excel Worksheet Functions 3 October 2nd 05 03:30 AM
Userform Reset After Scrolling JoJo Excel Programming 0 July 2nd 04 05:26 AM
Userform inside another userform Ryan Excel Programming 0 April 23rd 04 08:01 PM


All times are GMT +1. The time now is 02:38 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"