Results 1 to 7 of 7

Add to Selection by Right Clicking & Union

Threaded View

  1. #1
    Registered User
    Join Date
    07-03-2014
    Location
    East Lansing
    MS-Off Ver
    2010
    Posts
    20

    Add to Selection by Right Clicking & Union

    I'm trying to make a code so that when optionbutton1 is checked, it allows you to right click to select a cell, then right click on a different cell and select that cell as well as the previous cell, etc. Here's What I have so far.

    Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
    Dim S As Range
    
    If UserForm3.OptionButton1 = True Then
    Cancel = True
    
    If S Is Nothing Then
    Set S = Selection
    End If
    
    Application.Union(S, Target).Select
    End If
    End Sub
    Last edited by TheSpriceEffect; 07-16-2014 at 09:37 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Range/union
    By Dibbley247 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-22-2013, 10:35 AM
  2. Replies: 1
    Last Post: 02-07-2012, 07:09 AM
  3. VBA - Help with Union All
    By JohnM3 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-31-2011, 05:14 PM
  4. Paste a Union range selection into email body
    By VD82 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-23-2009, 05:47 PM
  5. [SOLVED] Union
    By Arne Hegefors in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-24-2006, 11:30 AM

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