Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default selection all textboxes in userform at once

I made a userform with over 20 textboxes (TBX). All boxes have a 'easy to
understand' name. At some moment I need all testboxes to be 'opened' or
'blocked' or to be 'emptied'. Is there a way to select all TBX at once?

My current solution looks like this:

MultiPage1.Value = 0 'Gegevens
GegKl.Enabled = True
GegNm.Enabled = True
GegRubr1.Enabled = True
GegRubr2.Enabled = True
GegStnr.Enabled = True
GegWplts.Enabled = True
MultiPage1.Value = 1 'Dressuur
DrPnt.Enabled = True
DrPntOv.Enabled = True
DrStnr.Enabled = True

Thank you so much for your help!!

--
Message posted via http://www.officekb.com
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default selection all textboxes in userform at once

I don't think that you can select one type of controls, and change there
values at the same time. You can loop through your controls. I've
posted some code I've used to clear all my text boxes.

For Each txtcontrol In Controls
If Left(txtcontrol.Name, 2) = "tx" Then txtcontrol.Text = ""
Next

As a naming standard, all of my text boxes start with "tx" so that is
how I clear only text boxes.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default selection all textboxes in userform at once

In addition to Claud's suggestion, you can also check the type of each
control. Something along the lines of

Dim x As MSForms.Control
For Each x In Me.Controls
If TypeOf x Is MSForms.TextBox Then
x.Enabled = Not x.Enabled
End If
Next x

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article ,
says...
I made a userform with over 20 textboxes (TBX). All boxes have a 'easy to
understand' name. At some moment I need all testboxes to be 'opened' or
'blocked' or to be 'emptied'. Is there a way to select all TBX at once?

My current solution looks like this:

MultiPage1.Value = 0 'Gegevens
GegKl.Enabled = True
GegNm.Enabled = True
GegRubr1.Enabled = True
GegRubr2.Enabled = True
GegStnr.Enabled = True
GegWplts.Enabled = True
MultiPage1.Value = 1 'Dressuur
DrPnt.Enabled = True
DrPntOv.Enabled = True
DrStnr.Enabled = True

Thank you so much for your help!!


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
UserForm TextBoxes Rob Excel Discussion (Misc queries) 2 August 6th 05 03:07 AM
userform & textboxes beginner Excel Programming 3 July 27th 04 10:56 AM
userform textboxes again Jo[_6_] Excel Programming 4 October 21st 03 07:25 PM
userform textboxes Jo[_6_] Excel Programming 4 October 21st 03 07:15 PM
add numbers in textboxes on userform KimberlyC Excel Programming 5 September 18th 03 06:15 AM


All times are GMT +1. The time now is 05:34 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"