Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / January 2006

Tip: Looking for answers? Try searching our database.

Loop Through textbox in Excel

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
sweet - 24 Jan 2006 15:54 GMT
Hi,

I have around 30 textboxes in my Excel 2003. and were created by
=EMBED("Forms.TextBox.1","")

I wonder how I can loop through them using VB within Excel. I have
tried
1. me.controls
2.msforms.textbox
3.OLEObjects

But none of them seems to work. Can you please let me know the syntax
so that I can get each textbox through a loop?

Thanks in advance. Your advice and help would be greatly appreciated.
Tom Ogilvy - 24 Jan 2006 16:04 GMT
Dim obj as OleObject
Dim tbox as MSForms.TextBox
for each obj in ActiveSheet.OleObjects
 if typeof obj.Object is MSforms.TextBox then
   set tbox = obj.Object
   msgbox tbox.Name & " - " & tbox.Value
 end if
Next

Signature

Regards,
Tom Ogilvy

> Hi,
>
[quoted text clipped - 11 lines]
>
> Thanks in advance. Your advice and help would be greatly appreciated.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.