+ Reply to Thread
Results 1 to 6 of 6

If statement to change Combo box's Row-source?

  1. #1
    Forum Contributor
    Join Date
    08-24-2012
    Location
    Hollidaysburg, Pa
    MS-Off Ver
    Excel 2010
    Posts
    398

    If statement to change Combo box's Row-source?

    Can I change the Rowsourse of a combox based on a value.

    My attempt :
    • Using IF statement
    • to get a clear idea, pls view attached picture1.png and xl sheet.



    Following was the code I tried :

    Please Login or Register  to view this content.

    Thanks,
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by Cutter; 08-24-2012 at 05:40 PM.

  2. #2
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: If statement to change Combo box's Row-source?

    @ subbby

    Welcome to the forum.

    Please notice that code tags have been added to your post(s). The forum rules require them so please keep that in mind and add them yourself whenever showing code in any of your future posts. To see instructions for applying them, click on the Forum Rules button at top of the page and read Rule #3.
    Thanks.

  3. #3
    Forum Contributor
    Join Date
    08-24-2012
    Location
    Hollidaysburg, Pa
    MS-Off Ver
    Excel 2010
    Posts
    398

    Re: If statement to change Combo box's Row-source?

    @Cutter
    M sorry. Very sorry. Will keep that in mind for sure, next time

    Thanks...

  4. #4
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: If statement to change Combo box's Row-source?

    Hi, Subbby. Try following example.
    Select "Manufacturing" or "Vendor" on the form in the file "Копия copying" and click OK.
    Pre-extract the archive to a separate folder on disk.
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    08-24-2012
    Location
    Hollidaysburg, Pa
    MS-Off Ver
    Excel 2010
    Posts
    398

    Re: If statement to change Combo box's Row-source?

    @Nilem

    Thank you very much. But I do have the following doubts. (m just 4 months old to VBA programming)
    Please Login or Register  to view this content.
    I did not understand the following things :
    1. Range A1 :- didn't understand its relation in this object's code. Went abck to sheet1 of worksheet. But found nothing in Range A1
    2. ToArr : - is ToArr a syntax or is it a dummy variable that u storing the formula which u are later on calling in the combo box ?

    I do have other doubts in Module 1's code. Will ask after I understand this. Thanks again

  6. #6
    Forum Contributor
    Join Date
    08-24-2012
    Location
    Hollidaysburg, Pa
    MS-Off Ver
    Excel 2010
    Posts
    398

    Re: If statement to change Combo box's Row-source?

    Also,

    I had other combo box that were dependent on the values selected on combobox1. Could you just show me an example of how to have the other combo box also to change their values based on the values of the previous combobox.

    My attempts :
    • Pls download my excel sheet.
    Last edited by subbby; 08-28-2012 at 10:13 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