+ Reply to Thread
Results 1 to 3 of 3

Placing a reference in another worksheet after an alert has been activated in another work

Hybrid View

  1. #1
    Registered User
    Join Date
    06-18-2014
    Location
    Dallas, Texas
    MS-Off Ver
    Home and Business 2010
    Posts
    84

    Placing a reference in another worksheet after an alert has been activated in another work

    I have created an alert for if a condition is met in one worksheet. I want to create a reference to this alert in another workbook with the date the alert was generated. Here is a sample workbook with the code for the alert and the way I tried to create the reference. Any help is greatly appreciated.SAMPLE.xlsm
    Attached Files Attached Files
    Last edited by clabhart; 06-25-2014 at 03:32 PM.

  2. #2
    Registered User
    Join Date
    06-18-2014
    Location
    Dallas, Texas
    MS-Off Ver
    Home and Business 2010
    Posts
    84

    Re: Placing a reference in another worksheet after an alert has been activated in another

    Here is an updated version of the code I'm trying to use
    Sub test()
    Dim rng As Range
    Dim rng2 As Range
    On Error Resume Next
    Dim a As Integer
    Set rng2 = Sheets("Sheet2").Range("A1")
    For Each rng In Range("Offset( B1, 0, 0, COUNTA(A:A), 1)")
        If rng.Value = Evaluate("TRUE") Or rng.Value = "PENDING" And Cells(rng.Row, "D") = "Y" And Cells(rng.Row, "E") = "" Then
            Cells(rng.Row, "E").Value = "RESOLVED"
            rng.Value = "PENDING"
            MsgBox "Alert for " & rng.Offset(0, -1).Value & ".", vbOKCancel, "Alert"
            rng2.Value = Cells(rng.Row, "A")
            rng2.Offset(0, 1).Value = Sheet1.Range("D7") & " ALERT"
            rng2.Offset(0, 2).Value = Evaluate("TODAY()")
        ElseIf Cells(rng.Row, "D") = "N" And Cells(rng.Row, "E") = "RESOLVED" Then
            Cells(rng.Row, "E").Value = ""
            rng.Value = "TRUE"
            End If
    Next
    On Error Resume Next
    End Sub

  3. #3
    Registered User
    Join Date
    06-18-2014
    Location
    Dallas, Texas
    MS-Off Ver
    Home and Business 2010
    Posts
    84

    Re: Placing a reference in another worksheet after an alert has been activated in another

    I found the solution here is the code for any one who is curious
    Sub test()
    Dim rng As Range
    Dim rng2 As Range
    On Error Resume Next
    Dim a As Long
    Set rng2 = Sheets("Sheet2").Range("A1")
    For Each rng In Range("Offset( B1, 0, 0, COUNTA(A:A), 1)")
        If rng.Value = Evaluate("TRUE") And Cells(rng.Row, "D") = "Y" And Cells(rng.Row, "E") = "" Then
            Cells(rng.Row, "E").Value = "RESOLVED"
            rng.Value = "PENDING"
            MsgBox "Alert for " & rng.Offset(0, -1).Value & ".", vbOKCancel, "Alert"
            With Sheets("Sheet2")
                a = .Range("A" & .Rows.Count).End(xlUp).Row
                rng2.Offset(0 + a, 0).Value = Cells(rng.Row, "A")
                rng2.Offset(0 + a, 1).Value = Sheet1.Range("D7") & " ALERT"
                rng2.Offset(0 + a, 2).Value = Evaluate("TODAY()")
                End With
        ElseIf Cells(rng.Row, "D") = "N" And Cells(rng.Row, "E") = "RESOLVED" Then
            Cells(rng.Row, "E").Value = ""
            rng.Value = "TRUE"
        ElseIf rng.Value = "PENDING" And Cells(rng.Row, "D") = "Y" And Cells(rng.Row, "E") = "" Then
            Cells(rng.Row, "E").Value = "RESOLVED"
            rng.Value = "PENDING"
            MsgBox "Alert for " & rng.Offset(0, -1).Value & ".", vbOKCancel, "Alert"
            With Sheets("Sheet2")
                a = .Range("A" & .Rows.Count).End(xlUp).Row
                rng2.Offset(0 + a, 0).Value = Cells(rng.Row, "A")
                rng2.Offset(0 + a, 1).Value = Sheet1.Range("D7") & " ALERT"
                rng2.Offset(0 + a, 2).Value = Evaluate("TODAY()")
                End With
            End If
    Next
    On Error Resume Next
    End Sub
    Also including the sample workbook which I used to create the code
    SAMPLE.xlsm

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. popup alert message during the worksheet open and continuous work on the sheet popup jump
    By shailkam2001 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-04-2014, 10:24 AM
  2. [SOLVED] Worksheet_Activate () - Need to work when any worksheet is activated
    By Jim McEwan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-15-2013, 10:02 PM
  3. Reference an entire worksheet within a work book?
    By sgillispie in forum Excel General
    Replies: 5
    Last Post: 03-09-2012, 01:14 PM
  4. [SOLVED] Worksheet reference (i.e placing worksheet name in a cell)
    By Roger Roger in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-20-2005, 12:06 PM
  5. [SOLVED] Using a cell reference to refernce worksheet in another work book
    By dmoc2005@yahoo.com in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-06-2005, 03:06 PM

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