Solved

Slight Modification to Macro

Posted on 2016-11-17
2
45 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Get HTML5 Certified

Want to be a web developer? You'll need to know HTML. Prepare for HTML5 certification by enrolling in July's Course of the Month! It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

635 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