+ Reply to Thread
Results 1 to 11 of 11

Data validation Change event

  1. #1
    Registered User
    Join Date
    08-27-2012
    Location
    Coimbatore,India
    MS-Off Ver
    Excel 2003
    Posts
    53

    Data validation Change event

    hi,

    i have listbox created through data validation.
    i need a macro to run when a change in the validated listbox occurs.

    note:we cant do this with worksheet change event

    can anuone help me on this??
    Regards,
    Satzz.

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Data validation Change event

    Hi, SathishKumar,

    note:we cant do this with worksheet change event
    The only other way I know is to link the cell to another one, use something like NOW() in another cell and use the Worksheet_Calculate. But my favourite would always be the Worksheet-Change. But even better would be not to use Data/Validation but a ComboBox instead and attach the macro to that (I would prefer the one from the Toolbox for the events available).

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Registered User
    Join Date
    08-27-2012
    Location
    Coimbatore,India
    MS-Off Ver
    Excel 2003
    Posts
    53

    Re: Data validation Change event

    Caio,
    I dint get you..
    Can you pls elaborate on this??

    Thanks.

  4. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Data validation Change event

    Hi, SathishKumar,

    for example your Data/Validation is in B2, put a formula in B3 referencing that cell:
    Please Login or Register  to view this content.
    If the Calculate-Event wonīt get fired on that enter another formula in B4
    Please Login or Register  to view this content.
    If calculation is set to automatic this will fire on any change of a formula in a cell.

    Iīm really interested of why you state that the Worksheet_Change-Event canīt be used - if any other procedure is started from that code for Data/Validation can be implemented there.

    Ciao,
    Holger

  5. #5
    Registered User
    Join Date
    08-27-2012
    Location
    Coimbatore,India
    MS-Off Ver
    Excel 2003
    Posts
    53

    Re: Data validation Change event

    caio,
    i'm giving u the full requirement
    i have attached the excel sheet.
    In that, column 1 has a data validation list.
    when i change the list value to h, and if it has empty value in the next 3 columns.
    then it should give me a message.
    i need this when a new change occurs in the validation list.
    could you help me in this..
    thanks...
    Attached Files Attached Files

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

    Re: Data validation Change event

    maybe so
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    08-27-2012
    Location
    Coimbatore,India
    MS-Off Ver
    Excel 2003
    Posts
    53

    Re: Data validation Change event

    nilem,
    you r so great..
    this is the apt one i needed.
    Thanks for this...
    but can you explain this...As i dont have deep knowledge in this..Can you/?

    thanks a lot.

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

    Re: Data validation Change event

    Ok, I'll try to comment on your words
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    08-27-2012
    Location
    Coimbatore,India
    MS-Off Ver
    Excel 2003
    Posts
    53

    Re: Data validation Change event

    Thank you so much..
    its hard to understand for me.coz i'm a beginner.
    but i'll try to learn this..
    i'll make this as solved.
    thanks again.

  10. #10
    Registered User
    Join Date
    08-27-2012
    Location
    Coimbatore,India
    MS-Off Ver
    Excel 2003
    Posts
    53

    Re: Data validation Change event

    @nilem,

    Below Qns for u::
    For the above condition,
    i need to update the color of the cell to blue if the next three values were empty.. i tried this but getting an error..
    And one more silly doubt.. In the above code why endif is not provided for IF condition??

    if you have any materials regarding this pls share with me..
    Thanks.

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

    Re: Data validation Change event

    Hi Satzz. "End If" not required for single-line If...Then, for example
    Please Login or Register  to view this content.
    try it
    Please Login or Register  to view this content.
    You can also use conditional formatting (see Sheet2 in attached file)
    Attached Files Attached Files

+ 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