+ Reply to Thread
Results 1 to 3 of 3

Linked Sheets, Sort Cells, Blanks to bottom

  1. #1
    Registered User
    Join Date
    09-13-2009
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    2

    Red face Linked Sheets, Sort Cells, Blanks to bottom

    Hi Everyone,

    I have a new spreadsheet I'm working on and I could use some help.

    I'm creating an excel sheet that is linked to several others. Basically my salesmen will enter their new prospects into their own sales sheets and that will transfer via a link to my main one. The problem I'm having is mainly with my sort. When the information is transferred, I need the sheet to auto sort the Company names alphabetically and move any blank cells to the bottom.

    Here's what I have so far in Visual Basic:

    Please Login or Register  to view this content.
    This should sort it and it does but it puts all of the blanks at the top and my data at the bottom. If I sort descending, then I get my Z's first and my A's last. I need to sort A - Z with the blanks to the bottom but of course all of those blank cells contain this data:

    Please Login or Register  to view this content.
    I've been working on this project for the better part of two weeks and it's due for presentation to the head of our department on Friday. Can you help me figure out a way to make this work? I'm willing to go back to the drawing board with code if I need to.

    Thanks very much
    Riv
    Attached Files Attached Files
    Last edited by Rivian; 09-13-2009 at 01:15 PM. Reason: solved

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Linked Sheets, Sort Cells, Blanks to bottom

    1) Change the formula in A6 to: =IF(C6="","",0)
    This will later cause empty rows to NOT be included in the sort, pushing them to the bottom.

    2) Click on Tools > Options > View and uncheck the [ ] Zero values option (this applies to this sheet only)

    3) To get your macro to sort first by column A with the now corrected 0s only and THEN by column C the names (results will be alphabetic), then this macro:
    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    09-13-2009
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Linked Sheets, Sort Cells, Blanks to bottom

    That's perfect! That completely solved my problem!

    Thanks so much for the super quick answer and easy to understand solution. This made my day!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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