+ Reply to Thread
Results 1 to 2 of 2

VBA for sorting lines leaving out A, AN and The

  1. #1
    Registered User
    Join Date
    09-19-2019
    Location
    Houston Tx
    MS-Off Ver
    Office 365
    Posts
    1

    Question VBA for sorting lines leaving out A, AN and The

    I'm new to Excel and haven't much of a clue on writing in VBA, but I was wondering if there was a way to have the words A, AN and THE ignored when the start a cell. I deal with the title of books and have written this little formula in a column and hide it, but if there was a different way using VBA on the column itself it would be very helpful for me.

    Here are my column heads, "TitleInfo = Title,Publisher,Year" joined together

    Title Title-A Publisher Year Current TitleInfo


    In Title A I wrote this Formula:
    =IF(A5="","",IF(LEFT(A5,2)="A ",CONCATENATE(MID(A5,3,500),", A"),IF(LEFT(A5,3)="An ",CONCATENATE(MID(A5,5,500),", An"),IF(LEFT(A5,4)="the ",CONCATENATE(MID(A5,5,500),", The"),A5))))

    As I said it works, but any suggestion would be greatly appreciated.

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: VBA for sorting lines leaving out A, AN and The

    Please attach a short Excel sample to help writting macros
    - Battle without fear gives no glory - Just try

+ 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] How to skip lines of data without leaving a gap in format
    By tkoral in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-13-2017, 11:43 AM
  2. Sorting 4 columns leaving spaces as needed
    By lukewp in forum Excel General
    Replies: 1
    Last Post: 02-19-2016, 02:33 PM
  3. [SOLVED] Is there a way to allow sorting, filters, and inserting lines to Locked sheets?
    By kaplanj23 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-06-2014, 12:49 PM
  4. Replies: 3
    Last Post: 05-22-2014, 07:51 AM
  5. [SOLVED] Sorting data with lines
    By alex.diederich in forum Excel General
    Replies: 4
    Last Post: 04-02-2013, 09:23 PM
  6. sorting, finding doubles, blank lines
    By redgreen in forum Excel General
    Replies: 3
    Last Post: 10-12-2009, 05:43 PM
  7. [SOLVED] Sorting a collection. *Leaving Duplicates*
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-03-2006, 07:20 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