Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 298
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default 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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 298
Default 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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 298
Default 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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Drawing toolbar Irv Setting up and Configuration of Excel 1 April 26th 07 04:10 AM
Drawing toolbar Icon Irv Excel Worksheet Functions 3 April 21st 07 01:18 AM
Drawing toolbar. Doc Secretary Excel Worksheet Functions 5 February 23rd 07 11:46 PM
drawing toolbar LWright Excel Discussion (Misc queries) 1 August 28th 06 03:19 AM
TextBox from Drawing toolbar - 2 questions Stuart[_5_] Excel Programming 2 July 27th 04 06:50 AM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"