View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
William[_2_] William[_2_] is offline
external usenet poster
 
Posts: 227
Default Clearing of textboxes

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



"CG Rosén" wrote in message
...
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
-------------------------------------------------------------