+ Reply to Thread
Results 1 to 7 of 7

Return selected cell from Combo box

  1. #1
    Registered User
    Join Date
    09-23-2010
    Location
    London, England
    MS-Off Ver
    2007
    Posts
    97

    Return selected cell from Combo box

    So i have a sheet which will grab a different record from a db and displays it on a page, it is then supposedly editable and can be altered and then saved back to the db.. this works ok at the mo :-)

    problem is when i use a form of validation which involves a combo box it reloads all my data, which i don't really want!

    Please Login or Register  to view this content.
    i need something a bit like that... only there is no command such as
    If Target.Address = Cells(2, 7).Address Then


    anyone know the correct syntax?

    thanks

  2. #2
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Return selected cell from Combo box

    Hmmm?

    ... only there is no command such as
    If Target.Address = Cells(2, 7).Address Then
    Target.Address will return what it says, as an absolute address.

    Cells(2, 7).Address returns:= $G$2

    I don't understand what you are really after, have you got this code in a Sheet Module?
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Return selected cell from Combo box

    I always use the Intersect method
    Please Login or Register  to view this content.
    Does that work for you?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Registered User
    Join Date
    09-23-2010
    Location
    London, England
    MS-Off Ver
    2007
    Posts
    97

    Re: Return selected cell from Combo box

    hmm well basicaly i have a combo box which picks up validation lists and uses these as a form of automcomplete!


    a better code that i need might be something like

    If TempCombo.LinkedCell = Cells(2, 7) Then

    but this doesn't quite work....
    could be in a pickle here

    i'll see if i can upload a sheet but has a bit of sensitive data in

  5. #5
    Registered User
    Join Date
    09-23-2010
    Location
    London, England
    MS-Off Ver
    2007
    Posts
    97

    Re: Return selected cell from Combo box

    Quote Originally Posted by ChemistB View Post
    I always use the Intersect method
    Please Login or Register  to view this content.
    Does that work for you?
    hi! i tried this but got a compile error, type mismatch!


    what does that mean?

    thanks

  6. #6
    Registered User
    Join Date
    09-23-2010
    Location
    London, England
    MS-Off Ver
    2007
    Posts
    97

    Re: Return selected cell from Combo box

    hmm.. an upload is going to error out as the connected db will not be found

    i can give you a code dump instead!

    Please Login or Register  to view this content.
    thanks so much guys

  7. #7
    Registered User
    Join Date
    09-23-2010
    Location
    London, England
    MS-Off Ver
    2007
    Posts
    97

    Re: Return selected cell from Combo box

    Another way... ignore all my rubbish code..

    how would you go about checking if the target of a combo box was the currently selected cell?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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