Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 161
Default Clearing trext box values

Hi,

is there a way to clear all the etxtboxes in a form (something like
fmTest.AllTextBoxes.Clear) rather than having to list them individually?

TIA

Dave
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Clearing trext box values

There's always a way...

Private Sub cmdNewPT_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''.


"Risky Dave" wrote:

Hi,

is there a way to clear all the etxtboxes in a form (something like
fmTest.AllTextBoxes.Clear) rather than having to list them individually?

TIA

Dave

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Clearing trext box values

Assuming fmTest is a UserForm, give this code a try...

Dim C As Object
For Each C In Me.Controls
If TypeName(C) = "TextBox" Then C.Text = ""
Next

--
Rick (MVP - Excel)


"Risky Dave" wrote in message
...
Hi,

is there a way to clear all the etxtboxes in a form (something like
fmTest.AllTextBoxes.Clear) rather than having to list them individually?

TIA

Dave


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 161
Default Clearing trext box values

Both,

Many thanks

"Risky Dave" wrote:

Hi,

is there a way to clear all the etxtboxes in a form (something like
fmTest.AllTextBoxes.Clear) rather than having to list them individually?

TIA

Dave

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
clearing duplicate values in Column A S Himmelrich Excel Programming 1 January 22nd 08 10:20 PM
Clearing all values in range that aren't formulas Barb Reinhardt Excel Programming 6 October 19th 06 01:29 PM
Clearing the Values in a Drop - Down List Sagu Excel Programming 2 March 31st 06 12:10 AM
Clearing Form Values the easy Way??? [email protected] Excel Programming 5 January 15th 05 07:31 AM
vba clearing out values stored in array chick-racer[_44_] Excel Programming 2 December 1st 03 09:05 PM


All times are GMT +1. The time now is 11:01 AM.

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"