Loading
Ozgrid Excel Help & Best Practices Forums

Excel Video Tutorials / Excel Dashboards Reports



Results 1 to 4 of 4

Thread: Show Address Of Double Click Of Cell

  1. #1
    Join Date
    6th August 2006
    Posts
    5

    Show Address Of Double Click Of Cell

    Can code detect a click or d-click in a cell in Excel and act on that somehow, without the normal edit-cell event?

    Thanks - Kirk

    Excel Video Tutorials / Excel Dashboards Reports


  2. #2
    Join Date
    24th January 2003
    Location
    Australia
    Posts
    31,717

    Re: Detect click event in cell

    Right click on the sheet name tab, choose View Code and sue the code below
    VB:
    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) 
        If Not Intersect(Target, Range("A1:A10")) Is Nothing Then 
            Cancel = True 
            MsgBox Target.Address 
        End If 
    End Sub 
    
    

  3. #3
    Join Date
    23rd May 2012
    Posts
    2

    Re: Detect click event in cell

    I modified the above code to this. I need effect of: Target = Range("C5:C13") so the corresponding value in Col C will be put in Col D. So when a cell in this range is double clicked the corresponding Cost from C will be put in the clicked cell. So I need to know the cell address I clicked so I can get the Cost from Col C.

    Thank you,

    VB:
    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) 
        If Not Intersect(Target, Range("D5:D13")) Is Nothing Then 
            Target = Range("C5") 
            Debug.Print Target 
        End If 
    End Sub 
    
    
    Procedure Cost 7101 7102 7103
    B C D E F
    DR Visit - Include eCRF & source docs for all 202 $ 202.00
    Surgical Intervention 105
    Catheter Reintervention 105
    Additional Implant Catheter 70
    Additional Implant Device Notification 70
    UnPLanned Follow UP 167 $ 167.00
    UnPLanned Echo 132

    Excel Video Tutorials / Excel Dashboards Reports


  4. #4
    Join Date
    23rd May 2012
    Posts
    2

    Re: Show Address Of Double Click Of Cell

    I figured it out see the code: Target.row give the row or target.address gives the cell address

    VB:
    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) 
        If Not Intersect(Target, Range("D5:Q13")) Is Nothing Then 
            Target = Range("C" & Target.Row) 
            Debug.Print Target, Target.Address, Target.Row 
        End If 
    End Sub 
    
    

    Excel Video Tutorials / Excel Dashboards Reports


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Possible Answers

  1. Hide/Show Rows on Double Click
    By xcelusr in forum EXCEL HELP
    Replies: 10
    Last Post: November 21st, 2012, 14:25
  2. Replies: 3
    Last Post: October 13th, 2011, 15:21
  3. Replies: 8
    Last Post: May 14th, 2010, 05:10
  4. Double Click In Cell To Show Current Date And Time
    By anktaggrwl in forum EXCEL HELP
    Replies: 7
    Last Post: March 27th, 2008, 17:32
  5. Show Calendar On Double Click
    By Joozh in forum EXCEL HELP
    Replies: 1
    Last Post: November 28th, 2006, 14:46

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
porno