+ Reply to Thread
Results 1 to 2 of 2

Text String Loop Question

  1. #1
    Registered User
    Join Date
    11-19-2010
    Location
    TN
    MS-Off Ver
    Excel 2007
    Posts
    4

    Text String Loop Question

    Hello.

    I was wondering if there is a way to use a text string for a ComboBox name in an if statement. Say I have 10 ComboBoxes in a UserForm named combobox1 combobox2, etc., and I wanted to set up a loop with 10 iterations. Is there a way to do something like:

    For j = 1 to 10
    If "userform1.combobox" & j = "100" Then
    ...
    End If
    Next j

    I tried this but it didn't work. Is this a dumb way of trying to do this? Any ideas?

    Thank you so much.
    Last edited by rwr; 01-27-2011 at 08:25 AM.

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Text String Loop Question

    Here is one approach which will run through all the controls - assign to a button perhaps.
    Please Login or Register  to view this content.

+ 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