Solved

Checkbox Notification

Posted on 2016-11-16
3
42 Views
Last Modified: 2016-11-17
I have a great little WB here that Ragonzo helped me with originally building.  

Here are the two enhancements I need:

 1.) If I want the "confidential" text to show up on Sheets 2 and 3, but want it to show up and disappear (depending on the status of the checkmark -- on/off) how do I distinguish between the cells?  Right now, it shows up at the same sell on each Sheet.

 2.) If I want to simply say "all sheets" so as not to have to identify each individual sheet, what line of code would I use to substitute where it tells which sheets to place the text?


Thank you in advance.

B.
Checkboxv2.xlsm
0
Comment
Question by:Bright01
  • 2
3 Comments
 
LVL 47

Accepted Solution

by:
Wayne Taylor (webtubbs) earned 500 total points
ID: 41890640
Try the below macro instead. To specify the cell for Sheet2 and Sheet3, modify the address in lines 19 and 21. The macro will also populate the specified cell in lines 22-23 for every worksheet, except for Sheet1.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)

    Application.EnableEvents = False
    
    Dim ws As Worksheet, CellValue As String
    
    If Target.Value = "P" Then
        CellValue = ""
        Target.Value = ""
    Else
        CellValue = "Confidential"
        Target.Value = "P"
    End If
    
    For Each ws In Worksheets
        If ws.Name <> Me.Name Then
            Select Case ws.Name
                Case "Sheet2"
                    ws.Range("C5").Value = CellValue
                Case "Sheet3"
                    ws.Range("D6").Value = CellValue
                Case Else
                    ws.Range("C5").Value = CellValue
            End Select
        End If
    Next
    
    Cancel = True
    
    Application.EnableEvents = True
    
End Sub

Open in new window

0
 

Author Comment

by:Bright01
ID: 41890753
This looks promising!!!  Let me test it.

B.
0
 

Author Closing Comment

by:Bright01
ID: 41891239
Wayne,

Thank you very much!  Fast, accurate and I learned something new.  What more could I ask for?  Thanks again,

B.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question