Multiple text boxes selection

  • Thread starter Thread starter Rafisahb
  • Start date Start date
R

Rafisahb

Does anybody know a command to select text boxs from a worksheet?

I can select one by one but if there is a shortcut to select some 50-60
text boxes at a time?
 
I've done it using the Select Multiple Objects tool on the Drawing toolbar.
 
Hi Rafisahb,

If you are talking about ActiveX controls then try this:

Sub SelectActiveXTextBoxes()
Dim OLEobj As Excel.OLEObject

ReDim myArray(0)
For Each OLEobj In ActiveSheet.OLEObjects
If TypeOf OLEobj.Object Is MSForms.TextBox Then
myArray(UBound(myArray)) = OLEobj.Name
ReDim Preserve myArray(UBound(myArray) + 1)
End If
Next OLEobj

If UBound(myArray) > 0 Then
ReDim Preserve myArray(UBound(myArray) - 1)
ActiveSheet.Shapes.Range(myArray).Select
End If
End Sub

Regards,
KL
 

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