Multiple text boxes selection

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?
 
K

KL

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
 
Top