Solved

Slight Modification to Macro

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

829 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