+ Reply to Thread
Results 1 to 5 of 5

Need help to paste email list view to excel

  1. #1
    Registered User
    Join Date
    08-28-2013
    Location
    chennai
    MS-Off Ver
    Excel 2010
    Posts
    20

    Need help to paste email list view to excel

    Hello members,

    I am now working on a macro that needs me to copy my outlook(inbox) emails from the list view onto an excel sheet. This will help me to do some evaluations;
    The problem iam facing is, while clicking Ctrl+A and Ctrl + C and pasting on to the excel sheet, the received date comes in three formats. If the email is received today, it will show as example, 3:30 PM. If the email is received yesterday, it will show as Thu, 3:30 PM., if it is last week, it will show the date 3/15/2017. Is there a way to bring these to a standard format in the excel sheet?

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Need help to paste email list view to excel

    In terms of the cell containing the date - in this case cell D3
    =IF(ISNUMBER(D3),IF(D3>1,D3,TODAY()),IF(ISNUMBER(FIND(":",SUBSTITUTE(D3,LEFT(D3,3),""))),TODAY()+IF(VLOOKUP(LEFT(D3,3),$O$2:$P$8,2,FALSE)-WEEKDAY(TODAY())>=0,VLOOKUP(LEFT(D3,3),$O$2:$P$8,2,FALSE)-WEEKDAY(TODAY())-7,VLOOKUP(LEFT(D3,3),$O$2:$P$8,2,FALSE)-WEEKDAY(TODAY())),DATEVALUE(SUBSTITUTE(D3,LEFT(D3,3),"")&"/"&YEAR(TODAY()))))

    Where Cells O2:P8 contain a lookup to assign a number to a day of the week.

    The attached file shows the helper columns used to develop the formula. The formula is a result of substituting the formulas in the helper columns into the final formula repeatedly until everything is defined in terms of cell D3.
    Attached Files Attached Files
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Need help to paste email list view to excel

    I just thought of something, the formula will break two weeks into the new year when it will interpret dates like 12/31 to be in the current year instead of last year. You can fix this with a helper column that has the following formula:
    =IF(L3>TODAY(),DATE(YEAR(L3)-1,MONTH(L3),DAY(L3)),L3) Where L3 is the cell with the computed date above.

    I will leave it as an exercise to the reader to roll this back to a single formula in terms of cell D3 alone. I'm not sure Excel can take formulas that long. The resulting formula will be 5 times longer than the one I gave in the previous post.

  4. #4
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Need help to paste email list view to excel

    P.P.S - You could also have a VB function read the inbound mailbox and get the dates straightway.

  5. #5
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Need help to paste email list view to excel

    Here is the VB version. The maximum number of records to read is in cell B1. The mailbox to read is in cell B3, the folder to read is in cell B5. The email list is on the email list sheet. In this case, I'm looking at all my mail in the Help Desk Folder - I just as well looked at Inbox or Sent Mail.
    Attached Files Attached Files

+ 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. Inserting Icon in List View VB & Select the coloum value of list view
    By AqieqS in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-25-2014, 10:15 PM
  2. Replies: 0
    Last Post: 02-21-2013, 04:46 AM
  3. Search and retrieve information from columns in Excel into list view (wildcards VBA)
    By martinl4 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-11-2011, 07:58 AM
  4. How to view entire drop down list in Excel 2007 (Win 7)
    By Sugartit in forum Excel General
    Replies: 3
    Last Post: 02-16-2011, 03:38 AM
  5. auto paste/forward email to folder/excel/wordreceive from a particular email ID
    By tariqnaz2005 in forum Outlook Formatting & Functions
    Replies: 1
    Last Post: 10-22-2009, 06:31 PM
  6. view email address behind object (picture) in excel
    By iwshim in forum Excel General
    Replies: 0
    Last Post: 03-26-2009, 07:35 PM
  7. [SOLVED] Hit email excel sheet, instead of print, how do I get normal view
    By Athena120169 in forum Excel General
    Replies: 2
    Last Post: 06-02-2006, 12: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