Refernence combo box in if statement
Refernence combo box in if statement
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 4 of 4

Thread: Refernence combo box in if statement

  1. #1
    New Member
    Join Date
    Mar 2002
    Location
    London
    Posts
    46
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Refernence combo box in if statement

     
    Hi all,

    I want to refernce a combo box on my sheet within an IF statement in a cell. e.g. =IF(mycombobox="hello",C1="huihni",C1="njdskds"). What is the correct syntax for the mycmbobox bit?

    Many Thanks,

    Greg

  2. #2
    MrExcel MVP phantom1975's Avatar
    Join Date
    Jun 2002
    Location
    Omaha, Nebraska
    Posts
    3,962
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I'm afraid you can't reference an object in a formula. Instead, you will have to use the LinkedCell property in the ComboBox. Set the LinkedCell to be any blank cell in your worksheet, say M23. Then change your formula to this:

    =IF(M23="hello",C1="huihni",C1="njdskds")
    Silly Billy was here....

    ***************** EXCEL/VB NEWBIES ARE MY FAVORITE! *****************

  3. #3
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Bogota, Colombia
    Posts
    11,959
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    You can use the linked cell of the combobox, and refer in the IF formula to that cell instead, but that depends on what type of combobox are you using, in other words, what toolbar did you use ?
    Regards,

    Juan Pablo González
    http://www.juanpg.com

  4. #4
    New Member
    Join Date
    Mar 2002
    Location
    London
    Posts
    46
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    That worked perfectly. Thanks to both of you.

    Greg

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 

 
DMCA.com