Results 1 to 5 of 5

Running Macro on Protected Sheet with Message Box

Threaded View

  1. #1
    Forum Contributor
    Join Date
    01-06-2015
    Location
    Huntsville, AL
    MS-Off Ver
    Office 365
    Posts
    185

    Running Macro on Protected Sheet with Message Box

    I have a sheet that I have various Messages populating, based off of a Value. I do not want my formulas to be deleted. Here is the code I have. I have tried many different options to no success. My macro will run, but it will not allow the Message Boxes to Populate. The Work Sheet name is Data Sheet. Any and all help would be greatly appreciated. Also know that I am not very good with VBA. I have pieced this together. I know it could probably be cleaned up and made neater. Thanks,

    Private Sub Worksheet_Change(ByVal Target As Range)
    
    Application.EnableEvents = False
    
     Call PTREFRESH
        ActiveSheet.PivotTables("PivotTable3").PivotCache.Refresh
        Target.Offset(1, 0).Activate
        
        
        Application.EnableEvents = True
    
           If Range("G6") = "WRONG PART" Then
        MsgBox "              WRONG PART   " & vbNewLine & "               SCANNED!!! "
    End If
    
           If Range("H6") = "WRONG PART" Then
        MsgBox "              WRONG PART   " & vbNewLine & "               SCANNED!!! "
    End If
    
           If Range("I6") = "WRONG PART" Then
        MsgBox "              WRONG PART   " & vbNewLine & "               SCANNED!!! "
    End If
    
           If Range("J6") = "WRONG PART" Then
        MsgBox "              WRONG PART   " & vbNewLine & "               SCANNED!!! "
    End If
    
           If Range("K6") = "WRONG PART" Then
        MsgBox "              WRONG PART   " & vbNewLine & "               SCANNED!!! "
    End If
    
           If Range("L6") = "WRONG PART" Then
        MsgBox "              WRONG PART   " & vbNewLine & "               SCANNED!!! "
    End If
    
           If Range("M6") = "WRONG PART" Then
        MsgBox "              WRONG PART   " & vbNewLine & "               SCANNED!!! "
    End If
    
           If Range("N6") = "WRONG PART" Then
        MsgBox "              WRONG PART   " & vbNewLine & "               SCANNED!!! "
    End If
    
           If Range("O6") = "WRONG PART" Then
        MsgBox "              WRONG PART   " & vbNewLine & "               SCANNED!!! "
    End If
    
           If Range("P6") = "WRONG PART" Then
        MsgBox "              WRONG PART   " & vbNewLine & "               SCANNED!!! "
    End If
    
           If Range("Q6") = "WRONG PART" Then
        MsgBox "              WRONG PART   " & vbNewLine & "               SCANNED!!! "
    End If
    
           If Range("R6") = "WRONG PART" Then
        MsgBox "              WRONG PART   " & vbNewLine & "               SCANNED!!! "
    End If
    
           If Range("S6") = "WRONG PART" Then
        MsgBox "              WRONG PART   " & vbNewLine & "               SCANNED!!! "
    End If
    
           If Range("T6") = "WRONG PART" Then
        MsgBox "              WRONG PART   " & vbNewLine & "               SCANNED!!! "
    End If
    
           If Range("U6") = "WRONG PART" Then
        MsgBox "              WRONG PART   " & vbNewLine & "               SCANNED!!! "
    End If
    
           If Range("V6") = "WRONG PART" Then
        MsgBox "              WRONG PART   " & vbNewLine & "               SCANNED!!! "
    End If
            If Range("CO11") = "TOO MANY" Then
        MsgBox "               TOO MANY   " & vbNewLine & "               SCANNED!!! "
    End If
    
            If Range("E7") = "COMPLETE" Then
        MsgBox "               ORDER   " & vbNewLine & "               COMPLETE "
    End If
    
    End Sub
    Last edited by Chris McGlothen; 02-03-2016 at 12:45 PM. Reason: Did not meet Forum Requirements

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Running Macro and Worksheet Change on PROTECTED Sheet?
    By ksayet in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-03-2015, 01:07 PM
  2. Running Macro and Worksheet Change on PROTECTED Sheet?
    By ksayet in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-03-2015, 10:58 AM
  3. Running Macro and Worksheet Change on PROTECTED Sheet?
    By ksayet in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-03-2015, 10:16 AM
  4. Running Macro and Worksheet Change on PROTECTED Sheet?
    By ksayet in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-03-2015, 09:36 AM
  5. Running Macro in Password protected sheet in excel 2007
    By alla_ratnaji in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-28-2012, 03:30 AM
  6. Excel 2007 : Running a Macro on a Password Protected Sheet
    By Martin Chamberlin in forum Excel General
    Replies: 1
    Last Post: 05-05-2011, 09:27 AM
  7. Error- Running a Macro on a Protected Sheet
    By nacho in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-20-2007, 08:21 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