Retrieve Mail IDs

     

  • Retrieve any mail ids from the available List
  •  

  • Through this program user can segregate the data using MID function
  • It allows the user to bifucate the data based on mailID
  •  

     

     

    Sub Mail_Ids()
    'To clear the rows in column B
    Range(Range("B2"), Range("B2").End(xlDown)).Rows.Select
    Selection.Clear
    'Define the length of string through Len function
    Dim L
    L = Len(Range("D2") & Range("E2"))
    MsgBox "Hi you are capturing " & Range("D2") & " Maild IDs"
    'Use Mid Function to retrieve part of string
    Dim i As Integer
    'It denotes maximum number of rows in column A
    Max = Range("A2").End(xlDown).Row
    'Create a variable and to dispaly result, Here i want to dispaly result _
    in column B from 2nd row

    Dim j As Integer
    j = 2
    'Run the loop from 2nd row to last row based on Column A
    For i = 2 To Max
    If Mid(Right(Range("A" & i), L), 1) = Range("D2") & Range("E2").Value Then
    Range("B" & j).Value = Range("A" & i).Value
    j = j + 1
    End If
    Next
    End Sub

     

     

     

    Download The Workbook