View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Find / Search for text boxes in a worksheet

The previous code ran fine for me before I posted it. However,

Put this in a general module in your workbook (in the vbe, Insert=Module).
Put it in that module.

Sub DetermineType()
Dim cnt As Long, tbox As OLEObject
MsgBox "Textboxes from drawing toolbar: " _
& ActiveSheet.TextBoxes.Count
cnt = 0
For Each tbox In ActiveSheet.OLEObjects
If TypeOf tbox.Object Is MSForms.TextBox Then
cnt = cnt + 1
End If
Next
MsgBox "Textboxes from the Control toolbox Toolbar: " & cnt
End Sub

--
Regards,
Tom Ogilvy


"John Ellis" wrote in message
...
Tom,

User-defined type not defined

is the error I am getting !!

If TypeOf tbox.Object Is MSForms.TextBox Then

Debugger stops at TypeOf


I hope that this makes sense ?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!