+ Reply to Thread
Results 1 to 3 of 3

loop through textbox in Excel

  1. #1

    loop through textbox in Excel

    In my Excel 2003, I have around 30 textbox, which is created by using
    the following formula

    =EMBED("Forms.TextBox.1","")

    I wonder how can I loop them through my VB editor within excel. I have
    try using

    me.controls
    msforms.textbox
    OLEObjects

    But none of them recognize what I am trying to do. So what is the
    syntax for getting all these controls?

    Thanks in advance and your help would be greatly appreciated.


  2. #2
    galimi
    Guest

    RE: loop through textbox in Excel

    You can loop through them using the Shapes collection under the particular
    Sheet object.
    --
    http://HelpExcel.com
    1-888-INGENIO
    1-888-464-3646
    x0197758


    "[email protected]" wrote:

    > In my Excel 2003, I have around 30 textbox, which is created by using
    > the following formula
    >
    > =EMBED("Forms.TextBox.1","")
    >
    > I wonder how can I loop them through my VB editor within excel. I have
    > try using
    >
    > me.controls
    > msforms.textbox
    > OLEObjects
    >
    > But none of them recognize what I am trying to do. So what is the
    > syntax for getting all these controls?
    >
    > Thanks in advance and your help would be greatly appreciated.
    >
    >


  3. #3
    Tom Ogilvy
    Guest

    Re: 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


    <[email protected]> wrote in message
    news:[email protected]...
    > In my Excel 2003, I have around 30 textbox, which is created by using
    > the following formula
    >
    > =EMBED("Forms.TextBox.1","")
    >
    > I wonder how can I loop them through my VB editor within excel. I have
    > try using
    >
    > me.controls
    > msforms.textbox
    > OLEObjects
    >
    > But none of them recognize what I am trying to do. So what is the
    > syntax for getting all these controls?
    >
    > Thanks in advance and your help would be greatly appreciated.
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1