+ Reply to Thread
Results 1 to 5 of 5

PrintOut results after looping thru all options in combo box

  1. #1
    Valued Forum Contributor ron2k_1's Avatar
    Join Date
    09-30-2009
    Location
    Not the USA
    MS-Off Ver
    Excel 2003, 2007
    Posts
    606

    PrintOut results after looping thru all options in combo box

    Hi all,

    I have this piece of code (attached as follows), but this is for looping thru a validation list. Is it possible to loop thru a combo box [OLEObjects("ComboBox1")]? The source list for the combo box exist in hidden cells B749:B765.

    Please Login or Register  to view this content.
    Ron
    Knowledge is knowing that a tomato and pepper are fruits. Wisdom is knowing whether to put these in a fruit salad

    Kindly

    [1] Use code tags. Place "[code]" before the first line of code and "[/code"]" after the last line of code. Exclude quotation marks
    [2] Mark your post [SOLVED] if it has been answered satisfactorily by editing your original post in advanced mode.
    [3] Thank (using the little scale) those that provided useful help; its nice and its very well appreciated

  2. #2
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: PrintOut results after looping thru all options in combo box

    something like

    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor ron2k_1's Avatar
    Join Date
    09-30-2009
    Location
    Not the USA
    MS-Off Ver
    Excel 2003, 2007
    Posts
    606

    Re: PrintOut results after looping thru all options in combo box

    Thanks for the suggestion Kyle, but not sure whether I can use your idea there (Unless I'm using it wrong).

    What I want is for the code to cycle thru each of the options under the combobox (ActiveX control) and then print the generated results (as a result of the different selections available under that combobox).

    For instance see the attached. Change the code line for the combo box so it can generate some options for you (the line for raguirre will give you a good idea of what I'm talking about). So, what I want is for the code to start selecting from the top - Select 645, print> Then select 646, print > Then select 647, print> and so on all the way till it reaches the last option in the combo box (in this case 662 if you modified the raguirre line for the combobox in the ThisWorkbook variable).

    Hope that made sense.

    Ron
    Attached Files Attached Files

  4. #4
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: PrintOut results after looping thru all options in combo box

    Changing the value in the combobox didn't do anything? I thought you meant a forms combobox, for an activeX, see below:

    Please Login or Register  to view this content.

  5. #5
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: PrintOut results after looping thru all options in combo box

    Well it ssmes to be rather odd that you assign a range to a combobox and after that you want to print the contents of that range row by row.

    to print the actual 'row' in the combobox:
    Please Login or Register  to view this content.
    NB. you can't print the values in a combobox; you have to store them first into a range in a workbook.

    looping:

    Please Login or Register  to view this content.
    Last edited by snb; 01-17-2012 at 06:26 AM.



+ 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