+ Reply to Thread
Results 1 to 5 of 5

Click Cell To Open Userform

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    09-26-2010
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    182

    Smile Click Cell To Open Userform

    Hi I have inserted the following code to open a userform when a blank cell is clicked. This works fine but what i need it to do is make it only open the userform when any of the Column A Cells A20:A174 are clicked. Is it also possible to make the user have to double click the cell to open the userform and disable the right mouse click


    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Target = "" Then Menu.Show
    End Sub
    Last edited by Mooseman60; 12-04-2010 at 08:51 AM.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,493

    Re: Click Cell To Open Userform

    Try this
    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    
        If Target.Count > 1 Then Exit Sub'remove,not required
    
        If Not Application.Intersect(Target, Me.Range("A20:A174")) Is Nothing Then
    
            Cancel = True
    
            If Target = "" Then Menu.Show
    
        End If
    
    End Sub
    Last edited by davesexcel; 12-04-2010 at 10:11 AM.

  3. #3
    Forum Contributor
    Join Date
    09-26-2010
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    182

    Re: Click Cell To Open Userform

    Dave

    That works perfectly thanks very much

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,493

    Re: Click Cell To Open Userform

    No problem,
    I suppose you don't require the Target.count part of the code, as you can only double click one cell anyway

  5. #5
    Registered User
    Join Date
    10-04-2012
    Location
    trinidad
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Click Cell To Open Userform

    What if you want to single click to do this?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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