+ Reply to Thread
Results 1 to 3 of 3

An ADD-On for an existing code

Hybrid 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

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: An ADD-On for an existing code

    What's in BG1???
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

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

    Re: An ADD-On for an existing code

    There is a value based on time and gives various time frames by comparing live feed and is like this: " BEWARE 940", " BEWARE 1020" ETC AS the case may be. Please tell me about it. The code above adds 1 to col G every time a value in D changes. I do not want to disturb that. So please help me if you can. thanx !

+ 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