Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
maybe something like this
For s = 0 To .Frame1.Controls.Count - 1 If .Frame1.Controls(s).Name Like "OptionButton*" Then -- Gary Keramidas Excel 2003 "Ryan H" wrote in message ... I have a sub (ClearUserform) that is called by several userforms. Sometimes the control may not be on the userform passed to ClearUserform, thus I get an error. So I added the On Error Resume Next statement to quickly work around the error. Is there a way to test if the control exists on the userform passed to the sub. Sub MySub() Call ClearUserform(Userform1) End Sub Sub ClearUserform(MyForm As UserForm) On Error Resume Next MyForm.TextBox1 = "" ' i have other controls list here On Error GoTo 0 End Sub -- Cheers, Ryan |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Test to see if Sheet exists | Excel Programming | |||
Names.add - Test to see if name already exists? | Excel Programming | |||
How to test if a DLL (library) exists | Excel Programming | |||
Test for Worksheet Exists | Excel Programming | |||
Test if a folder exists | Excel Programming |