+ Reply to Thread
Results 1 to 5 of 5

How to invert row selection in Excel & Can I sort on last letter of a text string?

  1. #1
    Registered User
    Join Date
    06-30-2020
    Location
    Chicago, IL
    MS-Off Ver
    16.38
    Posts
    4

    How to invert row selection in Excel & Can I sort on last letter of a text string?

    Two questions:

    1. I have selected certain full rows from my spreadsheet, and now I wish to invert that selection (i.e. I now want to select all the rows I didn't select in my first selection). How do I do that?

    2. I would like to sort the rows in a selection based on the last letter in a text string. Each row has a cell containing a 7-letter text string ending in either a W or an M. I need to sort by W and M. How could i do this?

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,427

    Re: How to invert row selection in Excel & Can I sort on last letter of a text string?

    I can't answer your first question.

    For your second question you could make use of a helper column with a formula like this:

    =RIGHT(cell,1)

    Copy that down, and then sort the data using the helper column as the key field, and then you can delete the helper column.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    06-30-2020
    Location
    Chicago, IL
    MS-Off Ver
    16.38
    Posts
    4

    Re: How to invert row selection in Excel & Can I sort on last letter of a text string?

    DISREGARD WHAT'S BELOW. I UNDERSTAND IT NOW.

    Pete,

    I'm sorry but I don't understand this. "RIGHT" is a formula? What does this formula do?

    I take it you want me to create a column to the left of the column that contains all the seven-character text strings. I did that and I pasted this formula into the first cell on that lefthand column, but it comes up as a naming error.

    Doug
    Last edited by jdouglasj; 06-26-2023 at 05:51 PM.

  4. #4
    Valued Forum Contributor
    Join Date
    11-27-2011
    Location
    usa
    MS-Off Ver
    Excel 2007, Excel 365
    Posts
    495

    Re: How to invert row selection in Excel & Can I sort on last letter of a text string?

    @jdouglasj, here is some vba code to handle your first question about inverting the the selection of rows:

    Please Login or Register  to view this content.

  5. #5
    Valued Forum Contributor
    Join Date
    11-27-2011
    Location
    usa
    MS-Off Ver
    Excel 2007, Excel 365
    Posts
    495

    Re: How to invert row selection in Excel & Can I sort on last letter of a text string?

    As far as your 2nd question goes, which column contains the 7-letter text string?

+ 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. How to invert cell selection in excel? I cant find how to do it...
    By pacosalasv in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 09-06-2021, 11:23 AM
  2. How to sort a text column by last letter, then second-last, and so on?
    By OldGrantonian in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-29-2019, 07:54 AM
  3. Replies: 15
    Last Post: 04-24-2017, 09:24 PM
  4. Invert Excel selection
    By aaajeto in forum Excel General
    Replies: 1
    Last Post: 10-09-2013, 09:14 AM
  5. Replies: 6
    Last Post: 07-03-2011, 08:08 PM
  6. Invert Selection of Cells
    By jman0707 in forum Excel General
    Replies: 6
    Last Post: 10-10-2008, 04:54 PM
  7. [SOLVED] Invert Excel Selection
    By Significent in forum Excel General
    Replies: 0
    Last Post: 03-11-2005, 10:06 PM

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