+ Reply to Thread
Results 1 to 13 of 13

VBA code to detect change in cells filled by combo box

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

    VBA code to detect change in cells filled by combo box

    Hi i need to be able to detect when values from a specific set of cells change. Current im using:

    Please Login or Register  to view this content.
    just for testing, to detect when any cell on the sheet is changed, however this doesn't detect changes from cell values which are changes as the result of a combo box being altered!..

    is there a way to do this?

    thanks

    Jonathan
    Last edited by Jollyfrog; 09-28-2010 at 06:08 AM.

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

    Re: VBA code to detect change in cells filled by combo box

    Please Login or Register  to view this content.



  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: VBA code to detect change in cells filled by combo box

    What type of ComboBox?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

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

    Re: VBA code to detect change in cells filled by combo box

    I'm using an activex combo box!

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

    Re: VBA code to detect change in cells filled by combo box

    The combo box itself fuctions correctly, it grabs a validation list and then inputs this to a desired cell, my problem is that excel does not detect the new cell value as a change and therefore does not execute any code ties to the change of a cell value.. bit anoying really :-(

    was wondering if people had experianced this in the past and knew of ways to get round this or to use an entirely different method of detecting cell changes

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

    Re: VBA code to detect change in cells filled by combo box

    If you use the code I gave you'll see that every change in the combobox and cell(4,4) respectively will trigger the worksheet_change event.

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

    Re: VBA code to detect change in cells filled by combo box

    Ah cunning... totally missed the point first time i read that..

    this seems to work, thanks!

  8. #8
    Registered User
    Join Date
    02-21-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: VBA code to detect change in cells filled by combo box

    Quote Originally Posted by snb View Post
    If you use the code I gave you'll see that every change in the combobox and cell(4,4) respectively will trigger the worksheet_change event.

    Hi,

    I am working on a similar thing, can I please get a copy of the code please

  9. #9
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: VBA code to detect change in cells filled by combo box

    The code is in post 2.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  10. #10
    Registered User
    Join Date
    02-21-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: VBA code to detect change in cells filled by combo box

    great! what if instead of a combobox I am using a drop down list? I want the macro to run if there is any change in the drop down value.

  11. #11
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: VBA code to detect change in cells filled by combo box

    dearsurabhi,

    Its better you post this question in a separate thread.

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

    Re: VBA code to detect change in cells filled by combo box

    It's better that you try to reason yourself instead of copying.

  13. #13
    Registered User
    Join Date
    02-21-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: VBA code to detect change in cells filled by combo box

    Thanks for the brilliant advice i was under the impression that this forum could be useful for people who maybe do not have a very indepth knowledge of VBA coding. just FYI - I would not be just copying and pasting anything that would be recommended

+ 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