ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   possible to enumerate objs from drawing toolbar - like textbox in (https://www.excelbanter.com/excel-programming/433989-possible-enumerate-objs-drawing-toolbar-like-textbox.html)

Rich

possible to enumerate objs from drawing toolbar - like textbox in
 
I have a bunch of textboxes from the Excel Drawing toolbar on a worksheet.
When I select a textbox I can see its codename in the Excel Namebox (upper
left corner of worksheet under file menu). Is there a VBA collection object
in Excel that would contain these drawing toolbar textbox objects so I could
loop through this collection? I want to loop through this collection or at
least be able to reference the textboxes through VBA so I can change the text
programmatically. How to do this?

Thanks,
Rich

Barb Reinhardt

possible to enumerate objs from drawing toolbar - like textbox in
 
I usually loop through the shapes collection on the worksheet and look for
shapes that meet a certain need. At first, I'd probably look for shape
names that contain text.

HTH,
Barb Reinhardt

"Rich" wrote:

I have a bunch of textboxes from the Excel Drawing toolbar on a worksheet.
When I select a textbox I can see its codename in the Excel Namebox (upper
left corner of worksheet under file menu). Is there a VBA collection object
in Excel that would contain these drawing toolbar textbox objects so I could
loop through this collection? I want to loop through this collection or at
least be able to reference the textboxes through VBA so I can change the text
programmatically. How to do this?

Thanks,
Rich


Rich

possible to enumerate objs from drawing toolbar - like textbox in
 
Well, so far I found the Shapes collection. Actually, I have a chart and
several textboxes from the drawing toolbar. When I loop through Shapes it
will identify the chart but only one of the drawing toolbar textboxes. I
have about 10 of them. How come the other 9 textboxes are not being
recognized? How can I get VBA to recognize them?


"Rich" wrote:

I have a bunch of textboxes from the Excel Drawing toolbar on a worksheet.
When I select a textbox I can see its codename in the Excel Namebox (upper
left corner of worksheet under file menu). Is there a VBA collection object
in Excel that would contain these drawing toolbar textbox objects so I could
loop through this collection? I want to loop through this collection or at
least be able to reference the textboxes through VBA so I can change the text
programmatically. How to do this?

Thanks,
Rich


Dave Peterson

possible to enumerate objs from drawing toolbar - like textbox in
 
If they are textboxes from the Drawing toolbar:

Dim myTB as Textbox
for each myTB in activesheet.textboxes
msgbox "Found one!"
next mytb

If they are textboxes from the Control Toolbox toolbar:

dim OLEObj as OLEObject
for each oleobj in activesheet.oleobjects
if typeof oleobj.object is msforms.textbox then
msgbox "found another one!"
end if
next oleobj




Rich wrote:

I have a bunch of textboxes from the Excel Drawing toolbar on a worksheet.
When I select a textbox I can see its codename in the Excel Namebox (upper
left corner of worksheet under file menu). Is there a VBA collection object
in Excel that would contain these drawing toolbar textbox objects so I could
loop through this collection? I want to loop through this collection or at
least be able to reference the textboxes through VBA so I can change the text
programmatically. How to do this?

Thanks,
Rich


--

Dave Peterson

Rich

possible to enumerate objs from drawing toolbar - like textbox in
 
Thanks all for the replies. I will give them a try.

"Rich" wrote:

I have a bunch of textboxes from the Excel Drawing toolbar on a worksheet.
When I select a textbox I can see its codename in the Excel Namebox (upper
left corner of worksheet under file menu). Is there a VBA collection object
in Excel that would contain these drawing toolbar textbox objects so I could
loop through this collection? I want to loop through this collection or at
least be able to reference the textboxes through VBA so I can change the text
programmatically. How to do this?

Thanks,
Rich



All times are GMT +1. The time now is 09:11 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com