LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Start a macro when a vlooup formula shows a new value

Here is a way
Code:
'===========================================================
'- CHECK FOR CHANGE IN A VLOOKUP VALUE
'- WE CANNOT CHECK FOR THE CHANGE DIRECTLY (eg.TargetValue)
'- BECAUSE IT DOES NOT FIRE A CHANGE EVENT ITSELF
'===========================================================
'- code runs whenever a change is made in the ws
'- Goes into ws code module. Right click tab. view code
'- Brian Baulsom November 2008
'============================================================

Private Sub Worksheet_Change(ByVal Target As Range)
    '- Saves the value in this subroutine
    Static A3value As Variant
    '--------------------------------------------------------
    '- check if the saved value is the same as it was
    If A3value < Range("A3").Value Then
        A3value = Range("A3").Value
        MsgBox ("A3 has changed to " & A3value)
    End If
End Sub


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
vlooup formula and if(),isna etc Claudia Excel Worksheet Functions 3 May 29th 07 01:17 PM
Macro to insert this formula automatically on start up [email protected] Excel Programming 10 November 7th 05 10:22 PM
cell shows 20. Formula shows 20. why not 540/27 griswold Excel Worksheet Functions 2 August 12th 05 05:56 PM
Alter data or start macro from a date formula DavidM Excel Programming 2 August 3rd 05 06:24 PM
Can I start a macro from a cell by using a formula PraxisPete Excel Worksheet Functions 1 April 8th 05 08:57 AM


All times are GMT +1. The time now is 03:04 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"