+ Reply to Thread
Results 1 to 5 of 5

Why can I not sort the data after a certain line of data

  1. #1
    Forum Contributor
    Join Date
    09-06-2011
    Location
    northern ireland
    MS-Off Ver
    Excel 365
    Posts
    180

    Why can I not sort the data after a certain line of data

    Please see code below - why after "Return" can I not sort the data ?
    any ideas ?

    Thanks

    Please Login or Register  to view this content.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Why can I not sort the data after a certain line of data

    Hi,

    Impossible to say without seeing the workbook in question. Would you upload it please.

    As an aside the macro looks as though it's been captured with the Macro recorder. This is fine for starters but code captured in this way is almost always too bloated and can be simplified considerably.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Contributor
    Join Date
    09-06-2011
    Location
    northern ireland
    MS-Off Ver
    Excel 365
    Posts
    180

    Re: Why can I not sort the data after a certain line of data

    Hi Richard

    Yes I am a novice and my intention is to get the code on paper and look for ways to make it smarter afterwards - as much as I can do.

    Thanks for helping - I attach the data to run the code ontest script 2.xls

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Why can I not sort the data after a certain line of data

    Hi,

    The code in the workbook is not consistent with that which you showed in your original post.

    Can we go back to basics and can you describe what you are trying to achieve. It seems that you want to start with your data sheet and then do something with it. If you can describe in a narrative form what that something is and manually create the Report sheet that you expect to see after the macro has processed then no doubt we can assist further,

  5. #5
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Why can I not sort the data after a certain line of data

    No code after Return will be processed since control passes back up to the line following the Gosub statement (who on earth uses Gosub these days?? [Edit: never mind - now I know who!]) and there's an Exit Sub preceding the GetDueDate label.
    Last edited by romperstomper; 09-30-2014 at 06:22 AM.
    Remember what the dormouse said
    Feed your head

+ 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] Data sort on 2 columns incorrect on one line
    By thadacto in forum Excel General
    Replies: 12
    Last Post: 11-06-2013, 07:45 AM
  2. Sort data - every 6th line
    By AngelaP in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-04-2012, 08:05 AM
  3. Insert Line In A Sort When Data Missing?
    By DonG in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-15-2011, 02:20 PM
  4. Line-up Columns by Sort and Leaving Blanks for no data.
    By peaceeasy in forum Excel General
    Replies: 1
    Last Post: 07-11-2011, 07:35 PM
  5. Macro to sort data, insert a line after each group & then total?
    By karinmpfa in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-24-2006, 08:15 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