+ Reply to Thread
Results 1 to 6 of 6

VBA to sort with certain requirements (workbook attached)

  1. #1
    Forum Contributor
    Join Date
    08-22-2013
    Location
    USA
    MS-Off Ver
    MS Office for Office 365 (Latest - 32-bit)
    Posts
    107

    VBA to sort with certain requirements (workbook attached)

    Hi,

    Please see the attached workbook. I am trying to determine what would be the VBA to sort data in A5:L34 considering the following:

    1. The range will always be A5:L34, but the rows containing all zeroes will change frequently.
    2. The zero rows will always start after all pertinent data to be sorted (there will never be zero rows between rows of data)
    3. The sub-range of A5:L34 (in the case of the attached, A5:L11) which contains non-zero rows should be sorted alphabetically, first by column C, then by column D.

    After the sort is done, I'd then want to clear all zero rows so all that's left is rows with data, sorted alphabetically as outlined above.

    Is this do-able? Where I'm struggling is no matter what I try, it always wants to put the cells with the zeroes at the top of the sort.

    Thanks.
    Attached Files Attached Files

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

    Re: VBA to sort with certain requirements (workbook attached)

    Why don't you delete zero rows at the beginning ?
    - Battle without fear gives no glory - Just try

  3. #3
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: VBA to sort with certain requirements (workbook attached)

    Can use this

    Please Login or Register  to view this content.
    Kind regards
    Leo

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: VBA to sort with certain requirements (workbook attached)

    Here's how I read your question
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    08-22-2013
    Location
    USA
    MS-Off Ver
    MS Office for Office 365 (Latest - 32-bit)
    Posts
    107

    Re: VBA to sort with certain requirements (workbook attached)

    Quote Originally Posted by LeoTaxi View Post
    Can use this

    Please Login or Register  to view this content.
    Kind regards
    Leo
    Thank you Leo, this works exactly as I described. Very well done!

  6. #6
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: VBA to sort with certain requirements (workbook attached)

    Easy job with good description and file

    can you mark the case as solved ?

    thanks
    Leo

+ 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] If Formula Question (Workbook Example Attached)
    By swade730 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-13-2015, 02:35 AM
  2. Why is this VLOOKUP not working? (Attached workbook)
    By stan255 in forum Excel General
    Replies: 5
    Last Post: 11-23-2015, 02:57 AM
  3. Is it possible to send CDO with Activeworksheet attached rather than workbook?
    By 13lack13lade in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-18-2013, 06:42 PM
  4. Help with Rank, Auto Sort Features (Spreadsheet Attached)
    By jagerman18 in forum Excel General
    Replies: 2
    Last Post: 08-22-2012, 06:46 PM
  5. [SOLVED] Workbook randomly crashing (attached)
    By excelloser in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-27-2012, 04:38 AM
  6. Macro to sort attached file
    By Benjamin2008 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-09-2010, 01:15 AM
  7. keeping a toolbar attached to a workbook
    By Paul James in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-12-2005, 07:05 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