Clearing of textboxes

C

CG Rosén

Good Day Group,

Have before from this group received help with clearing of many TextBoxes
in a Userform with the below code.
Is it possible to modify this code to except one or two TextBoxes from being
cleared?

Brgds

CG Rosén
-------------------------------------------------------------
For Each Ctl In UserForm1.Controls
Select Case LCase(TypeName(Ctl))
Case "textbox"
Ctl.Text = vbNullString
End Select
Next
-------------------------------------------------------------
 
W

William

Hi


Dim ctrl As Variant
For Each ctrl In UserForm1.Controls
If TypeOf ctrl Is MSForms.TextBox Then
If Not ctrl.Name = "TextBox6" And _
Not ctrl.Name = "TextBox3" Then _
ctrl.Text = vbNullString
End If
Next ctrl

--


XL2003
Regards

William
(e-mail address removed)
 

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

Top