MID Function

     

     

     

  • It allows the user to retrieve the required portion of the data using MID function in VBa Macros
  •  

     

    Private Sub CommandButton1_Click()
    Dim max As Integer
    max = Range(Range("A1"), Range("A1").End(xlDown)).Rows.Count
    Dim i As Integer
    For i = 1 To max
    'MsgBox Len(Cells(i, 1)) - 1
    Cells(i, 2) = Mid(Cells(i, 1), 2, 3)
    Next
    End Sub

     

    Download The Workbook