Determine if control is present

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Some of the sheets contain a control named "DROP DOWN 1" and some don't. Does
someone have a function that will look at the active sheet and return "TRUE"
if the control exists?

Thanks much in advance.
 
Here is some code

On Error Resume Next
Set x = ActiveSheet.DropDowns("Drop Down 1")
On Error GoTo 0
If Not x Is Nothing Then
MsgBox "Dropdown exists"
End If

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
hi,

try this one

Dim sh As Shape

For Each sh In ActiveSheet.Shapes
MsgBox sh.FormControlType
Next

if you've got a 2 when msgbox, the you have at least a Dropdown on the
sheet.
You can do it if you like with the dropdown name but it's much more
hazardous cos' maybe the dropdown name don't begin by dropdown

So long.
 

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

Back
Top