Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Loop Through textbox in Excel

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.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Loop Through textbox in Excel

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

--
Regards,
Tom Ogilvy

"sweet" wrote in message
ups.com...
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.



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
loop through textbox in Excel [email protected] Excel Programming 2 January 24th 06 04:01 PM
Using a DO loop to add values into a textbox Ian B Excel Programming 2 September 12th 05 07:07 PM
HELP! I Lost The Ability To Advance From TextBox To TextBox With the ENTER Or The TAB Keys Minitman[_4_] Excel Programming 0 February 22nd 05 08:50 PM
Textbox Bug? Missing/delayed update of textbox filled via VBA MarcM Excel Programming 0 November 4th 04 05:47 PM
loop in a textbox libby Excel Programming 1 August 3rd 04 11:30 PM


All times are GMT +1. The time now is 10:14 AM.

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

About Us

"It's about Microsoft Excel"