Vba to move emails from Inbox to personal folder
Page 4 of 4 FirstFirst ... 234
Results 31 to 32 of 32

Thread: Vba to move emails from Inbox to personal folder

  1. #31
    Board Regular Pranesh's Avatar
    Join Date
    Jun 2014
    Posts
    207
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Vba to move emails from Inbox to personal folder

    Quote Originally Posted by Domenic View Post
    In that case, try the following...

    Code:
        'Filter items for date specified in cell A1
        If UCase(Worksheets("Sheet1").Range("A2")) = "MORNING" Then
            strFilter1 = "[ReceivedTime] >= '" & Format(Worksheets("Sheet1").Range("A1").Value, "ddddd h:nn AMPM") & "'"
            strFilter2 = "[ReceivedTime] < '" & Format(Worksheets("Sheet1").Range("A1").Value + TimeValue("2:00 PM"), "ddddd h:nn AMPM") & "'"
        ElseIf UCase(Worksheets("Sheet1").Range("A2")) = "EVENING" Then
            strFilter1 = "[ReceivedTime] >= '" & Format(Worksheets("Sheet1").Range("A1").Value + TimeValue("2:00 PM"), "ddddd h:nn AMPM") & "'"
            strFilter2 = "[ReceivedTime] < '" & Format(Worksheets("Sheet1").Range("A1").Value + 1, "ddddd h:nn AMPM") & "'"
        End If

    Hi Domenic,


    Your genius. It worked out perfectly. Thanks a ton for all your help.

  2. #32
    MrExcel MVP
    Join Date
    Mar 2004
    Location
    Canada
    Posts
    18,831
    Post Thanks / Like
    Mentioned
    35 Post(s)
    Tagged
    5 Thread(s)

    Default Re: Vba to move emails from Inbox to personal folder

    You're very welcome!

    Cheers!

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •