+ Reply to Thread
Results 1 to 7 of 7

Swap 2 Selected Names

  1. #1
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,164

    Swap 2 Selected Names

    Two days is enough time to waist on this problem so I come to you for help.

    I have a range of names and I want to select two of them using Ctrl Click and then press the button to swap them. Here is my partial code:
    Please Login or Register  to view this content.
    When I do a For Each Cel loop it shows both selected players and their respective cells.
    When I try to do a Selection(2) it is not the correct words for VBA to understand.

    Hints please.
    VBA to Swap 2 SELECTED names.xlsm
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Swap 2 Selected Names

    Why aren't you using Players in the rest of the code?

    Also, you might want to look at using Areas.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    03-10-2013
    Location
    Budapest, Hungary
    MS-Off Ver
    Excel 2007
    Posts
    125

    Re: Swap 2 Selected Names

    Please Login or Register  to view this content.

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,164

    Re: Swap 2 Selected Names

    @Norie,

    I think "Areas" is exactly what I needed. Why doesn't Areas need to be Dim'ed as a range?

  5. #5
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Swap 2 Selected Names

    It doesn't need to be dimmed at all, Areas is a property of Range which contains a collection of the ranges within a range.

  6. #6
    Forum Contributor
    Join Date
    03-10-2013
    Location
    Budapest, Hungary
    MS-Off Ver
    Excel 2007
    Posts
    125

    Re: Swap 2 Selected Names

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    03-10-2013
    Location
    Budapest, Hungary
    MS-Off Ver
    Excel 2007
    Posts
    125

    Re: Swap 2 Selected Names

    Please Login or Register  to view this content.

+ 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. [SOLVED] Email tracker to selected names
    By JamesJoshua in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-23-2016, 08:43 AM
  2. Adding names selected in a drop down list
    By guy0nthec0uch in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 10-13-2014, 05:44 PM
  3. Names subtracting after they have already been selected in another combobox.
    By Sean Gillan in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-22-2014, 06:35 PM
  4. [SOLVED] Swap Selected Visible Cells to Values to right of the Selection
    By Brawnystaff in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-12-2014, 02:46 PM
  5. [SOLVED] Delete names in a selected range
    By Linky in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-26-2013, 08:13 PM
  6. [SOLVED] Array of all selected sheet names?
    By quartz in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 10-05-2005, 04:05 AM
  7. How to swap around First and Last Names in one column ?
    By Dbase Beginner in forum Excel General
    Replies: 1
    Last Post: 03-07-2005, 11:54 AM

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