Solved

Slight Modification to Macro

Posted on 2016-11-17
2
27 Views
Last Modified: 2016-11-17
I had this question after viewing Checkbox Notification.

I have one mod. that needs to be made here.  Right now it looks at "active cell" for a double click to produce the checkmark.  I need it to look at A SPECIFIC CELL.  In the case of the example attached, it needs to look at "Sheet1, Cell C4".  

Thank you in advance!

B.
Checkboxv3.xlsm
0
Comment
Question by:Bright01
2 Comments
 
LVL 43

Accepted Solution

by:
Saqib Husain, Syed earned 500 total points
ID: 41891330
This should take care of the active cell problem

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    Application.EnableEvents = False
    
    Dim ws As Worksheet, CellValue As String
        
    If Target.Address = Range("C4").Address Then
        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("F7").Value = CellValue
                End Select
            End If
        Next
    End If
    Cancel = True
    
    Application.EnableEvents = True
    
End Sub

Open in new window

0
 

Author Closing Comment

by:Bright01
ID: 41891513
Saqib,  Thank you very much!  Works perfectly.  

B.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

810 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