Select text boxes code

B

Bourbon

What would a code that would say:

Select all the text boxes in columm E......

Thanks,
B
 
T

Tom Ogilvy

I am not going waste time trying to select them, but you can work with them:

dim tbox as MSForms.Textbox
for each oleObj in Activesheet.OleObjects
if typeof oleObj.Object is MSforms.Textbox then
set tbox = oleObj.Object
if tbox.topLeftCell.Column = 5 then
tbox.Text = "In col E"
end if
End if
Next
 
N

Nicky

Hi B
This selects them
Sub select_shapes_in_col_e()
Dim shape_names()
shape_names = Array()
n = 0

For Each ss In ActiveSheet.Shapes
If ss.TopLeftCell.Column = 5 And ss.Type = 17 Then
ReDim Preserve shape_names(n)
shape_names(n) = ss.Name
n = 1 + n
End If
Next

ActiveSheet.Shapes.Range(shape_names).Select
End Su
 
B

Bourbon

Hi Nicky, first time we have spoken but thanks for the text boxe code.
made a few changes but your idea was great. Greatly appreciated!

Thanks,
B
 

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

Top