+ Reply to Thread
Results 1 to 3 of 3

Thread: Catch data validation change event Excel 2007

  1. #1
    Registered User
    Join Date
    07-28-2008
    Location
    Montréal
    Posts
    10

    Catch data validation change event Excel 2007

    Hi guys,

    I've implanted data validation into some cells and I need to be able to catch any modifications to these cells. If the user change the value from A to B, I would like to trap this event using VBA.

    I've tried to record a macro, change the value of the cell using the data validation but unfortunately, it didn't generate any code at all.

    Can someone point me in the right direction ?

    Thank you !

    Nicolas.

  2. #2
    Registered User
    Join Date
    07-28-2008
    Location
    Montréal
    Posts
    10
    I found it, I just have to catch the Worksheet change event !

    I guess there is no other way to proceed...

    Thanks anyways

  3. #3
    Forum Guru, retired Admin royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    25,639
    Assuming the validation is in C2 try
    Option Explicit
    
    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Address <> "$C$2" Then Exit Sub
    MsgBox Target.Value
    End Sub
    Hope that helps.

    RoyUK
    --------
    If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need

    For Excel Tips & Solutions, free examples and tutorials why not check out my downloads

    New members please read & follow the Forum Rules

    Remember to mark your questions Solved and rate the answer(s)

+ 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.2.0