+ Reply to Thread
Results 1 to 11 of 11

specific cell values based on a condition appearing in a combobox

  1. #1
    Forum Contributor
    Join Date
    10-27-2010
    Location
    singapore
    MS-Off Ver
    Excel 2003
    Posts
    107

    specific cell values based on a condition appearing in a combobox

    I have a set of data in a sheet something like the image below.
    11.JPG

    What I want to do is to look for the word “Digital” in column D and
    Once detected then take the value from column B that correspond with column D and place it in the combobox.
    Take a look at the image below:
    12.JPG

    I have attached a sample worksheet
    Sheet 1 contains a set of data
    Sheet 2 contains a combobox
    combo.xls
    Last edited by darkhorse4321; 01-15-2011 at 02:03 AM.

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

    Re: specific cell values based on a condition appearing in a combobox

    Please Login or Register  to view this content.



  3. #3
    Forum Contributor
    Join Date
    10-27-2010
    Location
    singapore
    MS-Off Ver
    Excel 2003
    Posts
    107

    Re: specific cell values based on a condition appearing in a combobox

    Thanks snb for your help. The codes worked with the sample file data i attached.
    But when i tried with another set of data it didn't work.
    BelowI have the file with the new set of data
    combo1.xls

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

    Re: specific cell values based on a condition appearing in a combobox

    In that case you will have to read my previous suggestion carefully, analyse it and try to understand what is does and how it does it. Then you will be able to adapt it to varying situations.(remember this subforum is about programming, the programming is not the exclusive helper's domain, but is also permitted to OP's).

  5. #5
    Forum Contributor
    Join Date
    10-27-2010
    Location
    singapore
    MS-Off Ver
    Excel 2003
    Posts
    107

    Re: specific cell values based on a condition appearing in a combobox

    Thanks snb for the help. I managed to identify the problem. It has got to do with the range

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

    Re: specific cell values based on a condition appearing in a combobox

    You got it !

  7. #7
    Forum Contributor
    Join Date
    10-27-2010
    Location
    singapore
    MS-Off Ver
    Excel 2003
    Posts
    107

    Re: specific cell values based on a condition appearing in a combobox

    Hi snb,

    i need to do a small editing to your codes.
    So far your codes will look for "digital" and take its corresponding value from column B.
    Now i want to add one more condition.
    I want to look for "YES" in column C
    so the statement will be something like when both sheet1!D1:D100="Digital" and sheet1!C1:C100="YES" matches, then place the corresponding value from column B onto the combobox

    Is it possible for you to help?

    Below are couple of codes i used but they didn't work.

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

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

    Re: specific cell values based on a condition appearing in a combobox

    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    10-27-2010
    Location
    singapore
    MS-Off Ver
    Excel 2003
    Posts
    107

    Re: specific cell values based on a condition appearing in a combobox

    Thanks snb for the reply, but the code didn’t work. There is some error in it.
    I noticed that there are 5 close brackets “ ) ”, but there is only 4 open brackets, “ ( “.
    So I tried changing the brackets but it still didn’t work.

  10. #10
    Registered User
    Join Date
    01-15-2011
    Location
    London
    MS-Off Ver
    NY
    Posts
    1

    Re: specific cell values based on a condition appearing in a combobox

    Thanks for your information.

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

    Re: specific cell values based on a condition appearing in a combobox

    Sometimes imagination will work....

    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