+ Reply to Thread
Results 1 to 3 of 3

VBA Mouse Click Event I need contained to specific area

Hybrid View

steves424 VBA Mouse Click Event I need... 12-06-2013, 12:26 PM
HaHoBe Re: VBA Mouse Click Event I... 12-06-2013, 02:45 PM
steves424 Re: VBA Mouse Click Event I... 12-06-2013, 06:09 PM
  1. #1
    Registered User
    Join Date
    12-06-2013
    Location
    Indiana, USA
    MS-Off Ver
    Excel 2007
    Posts
    2

    VBA Mouse Click Event I need contained to specific area

    I have a Macro for putting an X in a sheet that I need contained to cells B14 - R21. The double click Macro works perfect, I just want it contained to the specific range:


    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    Target = "X"
    End Sub
    If someone could help it would be much appreciated.
    Last edited by steves424; 12-06-2013 at 12:33 PM.

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 365 on Win11 (365 on Win11 (desktop), 365 on Win11 (notebook)
    Posts
    8,207

    Re: VBA Mouse Click Event I need contained to specific area

    Hi, steves424,

    maybe
    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    If Not Intersect(Target, Range("B14:R21")) Is Nothing Then
      Target = "X"
      Cancel = True
    End If
    End Sub
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Registered User
    Join Date
    12-06-2013
    Location
    Indiana, USA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: VBA Mouse Click Event I need contained to specific area

    Worked, awesome

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 0
    Last Post: 03-06-2013, 12:52 PM
  2. Prevent ListBox Click Event Until Mouse Click
    By bdb1974 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-08-2011, 12:23 PM
  3. Event generated with a mouse-click
    By hockey123 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-11-2010, 12:25 AM
  4. mouse click event?
    By Ramthebuffs in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-08-2006, 12:35 AM
  5. Keyboard/Mouse click event
    By bhavesh78 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-29-2005, 07:11 PM

Tags for this Thread

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1