+ Reply to Thread
Results 1 to 4 of 4

Columns don't sort properly in VBA

  1. #1
    Forum Contributor
    Join Date
    09-22-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Office 2019
    Posts
    309

    Angry Columns don't sort properly in VBA

    Hi Everyone!

    I'm in trouble again and it's driving me potty!
    I have a code driven by a button that copies and pastes data from column B in worksheet "Team List" into column A in worksheet "Trouble Shooter" and then copies data from column B in worksheet "Division Splits" and pastes it in column B in worksheet "Trouble Shooter". The worksheet "Trouble Shooter" then compares the data in the two columns to ensure they match.
    While the data in each is the same, the order it's in differs, so I'm attempting to sort each column into alphabetical order after it's pasted into the "Trouble Shooter" worksheet. I only want each column sorted, not the whole worksheet.
    However, it doesn't seem to matter what I do, the columns don't sort alphabetically, or sort at all some times. The code doesn't throw up any errors and once it's run I can sort the columns using Data / Sort without a problem. The columns have headers which are static on the main worksheet.
    Here's the bit of the code I have that fails.

    Please Login or Register  to view this content.
    Thanks in advance

    Frankie

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,631

    Re: Columns don't sort properly in VBA

    Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Contributor
    Join Date
    09-22-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Office 2019
    Posts
    309

    Re: Columns don't sort properly in VBA

    Have to work on that one as this is part of a multi sheet data loaded workbook at the moment.
    I'll get back to you

  4. #4
    Forum Contributor
    Join Date
    09-22-2013
    Location
    Sydney, Australia
    MS-Off Ver
    Office 2019
    Posts
    309

    Re: Columns don't sort properly in VBA

    Cracked it thanks. Went a different route!

+ 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] Modify Macro to Sort Properly
    By liquidmettle in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-12-2015, 12:18 PM
  2. Sort not working properly
    By bradleyandrewdavis in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-02-2015, 02:01 PM
  3. Won't permanently sort properly
    By GigaFluxx in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-14-2015, 11:32 AM
  4. [SOLVED] One cell won't sort properly in one column
    By joebell in forum Excel General
    Replies: 2
    Last Post: 11-10-2013, 02:13 AM
  5. [SOLVED] Sort function not working properly...
    By dllivermore in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-01-2012, 05:45 PM
  6. My numbers do not sort properly
    By MiriBella in forum Excel General
    Replies: 7
    Last Post: 06-20-2012, 06:31 PM
  7. Get macro to sort dates properly
    By DamienC in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-21-2008, 02:53 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