Consulting

Results 1 to 5 of 5

Thread: Help required: segregation of data

  1. #1

    Help required: segregation of data

    Hi

    I have the data extract from outlook which shows inbox and sent items data. now I need to segregate the mails based on the subject line which has been "replied" and "Forwarded" along with the initial mail found in Inbox

    out of sheet1, separate sheets should be generated for mails replied, mails forwarded and mails unattended. unattended mails would be mails for which neither reply nor forward found in Sent Items

    Kindly help
    Attached Files Attached Files

  2. #2
    Moderator VBAX Master georgiboy's Avatar
    Joined
    Mar 2008
    Location
    Kent, England
    Posts
    1,198
    Location
    If you created the sheets "RE" "FW" and "Unattended" then this would work, its a bit crude but it is how i would have done it

    [VBA]Sub MailSorter()
    Dim rCell As Range, Ender As Long

    Ender = Sheets("Sheet1").Range("D" & Rows.Count).End(xlUp).Row

    For Each rCell In Sheets("Sheet1").Range("D1" & Ender).Cells
    If Left(rCell.Value, 3) = "RE:" Then
    rCell.EntireRow.Copy
    Sheets("RE").Rows(Sheets("RE").Range("D" & Rows.Count).End(xlUp).Row + 1).PasteSpecial xlAll
    ElseIf Left(rCell.Value, 3) = "FW:" Then
    rCell.EntireRow.Copy
    Sheets("FW").Rows(Sheets("FW").Range("D" & Rows.Count).End(xlUp).Row + 1).PasteSpecial xlAll
    Else
    rCell.EntireRow.Copy
    Sheets("Unattended").Rows(Sheets("Unattended").Range("D" & Rows.Count).End(xlUp).Row + 1).PasteSpecial xlAll
    End If
    Next rCell

    End Sub[/VBA]

    Hope this helps
    Click here for a guide on how to add code tags
    Click here for a guide on how to mark a thread as solved
    Click here for a guide on how to upload a file with your post

    Excel 365, Version 2403, Build 17425.20146

  3. #3
    Hi georgiboy

    Thank your very for the reply, its working, however I need slight changes in the code, I have attached file explaining the request

    and its not copying header for RE and FW sheets

    kindly help me in this regard
    Attached Files Attached Files

  4. #4
    Hi

    Please help me with the above request

  5. #5
    Moderator VBAX Master georgiboy's Avatar
    Joined
    Mar 2008
    Location
    Kent, England
    Posts
    1,198
    Location
    Don't mean to be rude but i am offering help here. If you want someone to do your work for you then you could always hire someone

    Unless someone else here is willing to write your code for you line by line?
    Click here for a guide on how to add code tags
    Click here for a guide on how to mark a thread as solved
    Click here for a guide on how to upload a file with your post

    Excel 365, Version 2403, Build 17425.20146

Posting Permissions

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