+ Reply to Thread
Results 1 to 4 of 4

For each control in sheet

  1. #1
    Claus
    Guest

    For each control in sheet

    Hi

    I would like to adress all controlelements in my worksheet one by one using
    the "For Each"- statement, but i can't get it working.

    Dim i As Controls
    For Each i In Worksheets("Sheet1")
    MsgBox i.Name
    Next

    Hoping for help

    Claus



  2. #2
    Ivan Raiminius
    Guest

    Re: For each control in sheet

    Hi Claus,

    try something like this:

    for each oleobject in worksheets("Sheet1").oleobjects

    Regards,
    Ivan


  3. #3
    Bob Phillips
    Guest

    Re: For each control in sheet

    Dim i As Long

    For i = 1 To ActiveSheet.OLEObjects.Count
    MsgBox ActiveSheet.OLEObjects(i).Name
    Next i


    --
    HTH

    Bob Phillips

    (remove xxx from email address if mailing direct)

    "Claus" <[email protected]> wrote in message
    news:[email protected]...
    > Hi
    >
    > I would like to adress all controlelements in my worksheet one by one

    using
    > the "For Each"- statement, but i can't get it working.
    >
    > Dim i As Controls
    > For Each i In Worksheets("Sheet1")
    > MsgBox i.Name
    > Next
    >
    > Hoping for help
    >
    > Claus
    >
    >




  4. #4
    Claus
    Guest

    Re: For each control in sheet

    Hi Ivan

    Thank you, it works ;-)

    Claus

    "Ivan Raiminius" <[email protected]> skrev i en meddelelse
    news:[email protected]...
    > Hi Claus,
    >
    > try something like this:
    >
    > for each oleobject in worksheets("Sheet1").oleobjects
    >
    > Regards,
    > Ivan
    >




+ 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