+ Reply to Thread
Results 1 to 4 of 4

Help with Macro (now to sort by dates)

  1. #1
    Registered User
    Join Date
    12-17-2012
    Location
    Wolverhampton,England
    MS-Off Ver
    Excel 2007
    Posts
    15

    Help with Macro (now to sort by dates)

    Please Login or Register  to view this content.
    This sorts the data by using the 1st cell,4th cell,etc to the end of the row.
    now I wish it to sort by the 3rd cell,6th cell etc
    see excel sheet
    Thanks
    Steve.
    Last edited by pennbowl; 12-04-2014 at 04:39 PM.

  2. #2
    Registered User
    Join Date
    12-17-2012
    Location
    Wolverhampton,England
    MS-Off Ver
    Excel 2007
    Posts
    15

    Macro to sort by dates

    Sort by date
    Attached Files Attached Files
    Last edited by pennbowl; 12-04-2014 at 04:28 PM.

  3. #3
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: F/A/O HANSKEEBELLAH Macro works great but now wish to sort by date after using this ma

    Hi, pennbowl,

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    And maybe you should change the title of the thread to a better fitting.


    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  4. #4
    Registered User
    Join Date
    12-17-2012
    Location
    Wolverhampton,England
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Help with Macro (now to sort by dates)

    Change
    wsT.Sort.SortFields.Add Key:=Range("A1:A5"),
    To
    wsT.Sort.SortFields.Add Key:=Range("C1:CA5"),
    To
    That does the trick

+ 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. Macro To Sort Columns Only Works on One Tab
    By KimC in forum Excel General
    Replies: 17
    Last Post: 09-19-2014, 07:16 PM
  2. Macro works great in 2007 but not in older excel format
    By Tom R. in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-18-2013, 05:52 AM
  3. Replies: 3
    Last Post: 05-07-2012, 05:52 AM
  4. VBA Macro checks for duplicates,works great, but wish to add a select row
    By Mesjoggah in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-30-2011, 01:28 PM
  5. sort macro that works after leaving worksheet
    By garyablett in forum Excel General
    Replies: 1
    Last Post: 05-05-2006, 02:07 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