Results 1 to 3 of 3

An ADD-On for an existing code

Threaded View

  1. #1
    Forum Contributor
    Join Date
    12-11-2012
    Location
    India
    MS-Off Ver
    Excel 2019
    Posts
    321

    An ADD-On for an existing code

    Every time the cell value in BG1 changes I want a message box displaying the value of BG1 ( which will usually be like "BEWARE 940" etc. This I want to incorporate in the following existing code:-

    Dim OldValue1
    Dim OldValue2
    Dim OldValue3
    Dim OldValue4
    Dim OldValue5
    
    
    Private Sub Worksheet_Calculate()
    If [D1] <> OldValue1 Then
        Application.EnableEvents = False
            [G1] = [G1] + 1
            OldValue1 = [D1]
        Application.EnableEvents = True
    End If
    If [D2] <> OldValue2 Then
        Application.EnableEvents = False
            [G2] = [G2] + 1
            OldValue2 = [D2]
        Application.EnableEvents = True
    End If
    If [D3] <> OldValue3 Then
        Application.EnableEvents = False
            [G3] = [G3] + 1
            OldValue3 = [D3]
        Application.EnableEvents = True
    End If
    If [D4] <> OldValue4 Then
        Application.EnableEvents = False
            [G4] = [G4] + 1
            OldValue4 = [D4]
        Application.EnableEvents = True
    End If
    If [D5] <> OldValue5 Then
        Application.EnableEvents = False
            [G5] = [G5] + 1
            OldValue5 = [D5]
        Application.EnableEvents = True
    End If
    End Sub
    Please help me if you can....
    Last edited by Leith Ross; 12-25-2012 at 12:36 AM. Reason: Added Code Tags

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