+ Reply to Thread
Results 1 to 5 of 5

Outlook tasks move-up / move-down by VBA

  1. #1
    Registered User
    Join Date
    12-10-2008
    Location
    Aberdeen
    MS-Off Ver
    MS365 VER 2308
    Posts
    79

    Outlook tasks move-up / move-down by VBA

    I need to create a "WBS_SORT" VBA Macro to sort outlook tasks by custom "WBS" field, which has the below "text" format.

    ...
    ...
    9.9.9
    9.9.10
    9.9.11
    9.10
    9.10.1
    9.10.2
    10
    10.1
    10.1.1
    ...
    ...

    I know I can manually "drag" tasks up and down the displayed list, but I can't work out how to move them up or down programmatically.

    The sorting algorithm itself is easy enough - its just the physical "moving" of the tasks up or down that I'm struggling with.

    Many thanks
    Guy

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,936

    Re: Outlook tasks move-up / move-down by VBA

    Try this macro - assumes that you have a contiguous table, with headers, and with the WBS text values in the first column of the table.

    Please Login or Register  to view this content.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Registered User
    Join Date
    12-10-2008
    Location
    Aberdeen
    MS-Off Ver
    MS365 VER 2308
    Posts
    79

    Re: Outlook tasks move-up / move-down by VBA

    Hi Bernie - Does this apply to outlook tasks folder? Looks more like it applies to an excel range - which I already know how to do.
    Its specifically the part about moving outlook tasks up and down the task list that I'm finding a challenge.

    Also, are you sure this accomodates the sorting of 9.8, 9.9, 9.10, 9.11, 10, 10.1, 10.2 correctly? An alphabetic sort will put 9.10 before 9.9, and 10 before 9.x, which isn't correct. This is a WBS - not decimal numbers.
    Last edited by bluphoto; 07-22-2020 at 02:19 PM.

  4. #4
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,936

    Re: Outlook tasks move-up / move-down by VBA

    I'm sorry about that. I overlooked the "Other apps" part of the header.

    The macro was written for Excel, but will correctly sort an array that is read into it (using an array rather than a range) based on the string WBS values (they are converted to decimal numbers to do the sorting). If you read in an array, this version will sort it and then the array can be exported - the import and export in the example are based on an Excel range, but you could simply read and write the data array of the object of interest.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    12-10-2008
    Location
    Aberdeen
    MS-Off Ver
    MS365 VER 2308
    Posts
    79

    Re: Outlook tasks move-up / move-down by VBA

    Bernie,
    Specifically, in outlook, how do I move the tasks up and down to reflect the sorted list? I don't need to know about how to sort a WBS - I DO need to know about the specifics of MOVING OUTLOOK TASKS Up and Down, as per the subject line of this post.

    thanks
    Guy

+ 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. Outlook and VBA: move email items
    By Archangelos in forum Outlook Programming / VBA / Macros
    Replies: 0
    Last Post: 07-09-2019, 04:10 PM
  2. [SOLVED] Another one... VBA button including macro to move completed tasks to another spreadsheet
    By hvietkhoi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-31-2016, 03:06 AM
  3. Outlook Tasks - Adding tasks from a worksheet added today or after
    By dpotta in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-28-2010, 07:15 AM
  4. why can't you move colums in Excel like in Outlook?
    By Duke Carey in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 09-06-2005, 06:05 PM
  5. why can't you move colums in Excel like in Outlook?
    By Kerk Farrell in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 PM
  6. why can't you move colums in Excel like in Outlook?
    By Kerk Farrell in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  7. [SOLVED] How can I move Project tasks into an Excel outline?
    By Russell Daum in forum Excel General
    Replies: 0
    Last Post: 06-24-2005, 12:05 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