+ Reply to Thread
Results 1 to 6 of 6

Macro to sort data by column B within the Location & Total rows?.

  1. #1
    Registered User
    Join Date
    09-30-2011
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    9

    Macro to sort data by column B within the Location & Total rows?.

    Hi,
    I've been scracthing my head for days trying to do this by a macro, What I am trying to do is sort the data by column B with C-F linked to it, but leave everything else as it appears on the sheet?.

    Any help greatly appreciated..

    Gauges2.xlsx

    Paul

  2. #2
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628

    Re: Macro to sort data by column B within the Location & Total rows?.

    You could use this macro:
    Please Login or Register  to view this content.
    Regards,
    Antonio

  3. #3
    Registered User
    Join Date
    09-30-2011
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Macro to sort data by column B within the Location & Total rows?.

    Hi Antonio,
    Thank you for your speedy reply, I am getting an error on this line though?..

    lastRow = .Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row

    Cheers

    Paul

  4. #4
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628

    Re: Macro to sort data by column B within the Location & Total rows?.

    I've seen the macro but it seems to run fine... see attached file.

    Regards,
    Antonio
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    09-30-2011
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Macro to sort data by column B within the Location & Total rows?.

    Quote Originally Posted by antoka05 View Post
    I've seen the macro but it seems to run fine... see attached file.

    Regards,
    Antonio
    The workbook I posted was a small selection of the sheet. The one you posted works fine but the macro doesn't seem to work on the full workbook?... Maybe it is me doing something wrong. The amount of gauges between departments will vary from week to week also..

    Thank you in advance

    Gauges.xlsm

    Regards

    Paul

  6. #6
    Registered User
    Join Date
    09-30-2011
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Macro to sort data by column B within the Location & Total rows?.

    I think I have worked it out, I am trying to run it from a personal workbook which seems to be the problem.

    Paul

+ 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