Results 1 to 4 of 4

[SOLVED] Send Pop-Up Alert when the value in a cell on a non-active sheet <> 0

Threaded View

  1. #1
    Registered User
    Join Date
    04-25-2024
    Location
    North Carolina, USA
    MS-Off Ver
    2021
    Posts
    3

    [SOLVED] Send Pop-Up Alert when the value in a cell on a non-active sheet <> 0

    Hello,

    I am new to the forum and look forward to learning from all of you.

    I have a work file used by a lot of people and the data needs to reconcile on a final sheet. I already have the formula built in that cell which should stay at zero, but I find the cell does not always reconcile to zero when I open the file because the people using the file forget to check it still ties out, so then we don't know who accidentally messed it up so we can coach them, and more importantly what they did that caused the error so we can fix it.

    I would like to build an alert where regardless of the sheet that is active, if the cell on the non-active sheet no longer is zero (whether less than zero or greater than zero), a pop-up immediately alerts the user that the value on that cell has changed based on their last action.

    Here is what I have so far which I got offline using ChatGPT and then tried to modify, but I am running into two problems:

    1. This only works when the sheet is active (I have been posting this code to the code for the particular sheet, so I am hoping there is some way within ThisWorkbook that the code would work for the cell I want instead even if the sheet is not active).

    I tried to work around this issue by having a reference on each of the other sheets to the sheet and cell that should be zero, then using the same code as above for every sheet. For whatever reason, the code does not run on the sheets when I link it like this.

    2. Anytime the cell changes even if going back to zero, there is a pop-up message. Clearly I am not doing something right as it seems to notice when the formula in that cell runs rather than monitoring when the amount has changed from zero.


    Thank you in advance for your insight.

    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim numdependences As Integer
    On Error Resume Next
    HasDependents = Target.Dependents.Count
    If Err = 0 Then
        If InStr(Target.Dependents.Address, "$D$3") <> 0 Then
            MsgBox "You have initiated a calculation change on cell D3 of worksheet sheet1 with your last action.  Please check that cell"
        End If
    End If
    On Error GoTo 0
    End Sub
    Last edited by ignatius108; 04-26-2024 at 09:13 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] VBA code for last active cell to remove ordering alert?
    By kehong216 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-26-2020, 04:54 PM
  2. send value of cell in ACTIVE SHEET to a different sheet
    By Buratti in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-04-2016, 05:30 PM
  3. Send an ALERT email to a GMAIL address if conditions are met in a specific cell
    By zeegerman in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-25-2015, 04:56 PM
  4. Replies: 4
    Last Post: 12-06-2013, 02:39 PM
  5. Replies: 2
    Last Post: 07-31-2012, 10:00 PM
  6. Send Email From Active Sheet
    By dentdntn in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-02-2012, 05:23 AM
  7. [SOLVED] Send Email (Active Sheet)
    By Murtaza in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-25-2005, 09:06 AM

Tags for this Thread

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