Solved

Slight Modification to Macro

Posted on 2016-11-17
2
39 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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
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…

685 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