Extract "Capital letters" , "Small letters" , "Numbers" and "Symbols" from the text

follow this steps to use this formula:- 

step1:- Open excel sheet with macro




Step2:- paste formula in the macro's module




step3:- Open question 



syntex of the formula



step4:- put 1 in second syntex for "capital letters"



step5:- put 1 in second syntex for "small letters"



step6:- put 1 in second syntex for "numbers"



step7:- put 1 in second syntex for "special symbols"



code:-

--------------------------------------------------------

Function chootadon(x As String, k As Integer)

For a = 1 To Len(x)
       b = Mid(x, a, 1)

    For c = 65 To 90
      If Chr(c) = b Then
        p = p & b
      End If
    Next c
Next a

For c = 1 To Len(p)
       b = Mid(p, c, 1)
       x = WorksheetFunction.Substitute(x, b, "")
Next c



For a = 1 To Len(x)
       b = Mid(x, a, 1)
          For c = 97 To 122
            If Chr(c) = b Then
                       q = q & b
            End If
          Next c
Next a

For c = 1 To Len(q)
      b = Mid(q, c, 1)
      x = WorksheetFunction.Substitute(x, b, "")
Next c




For a = 1 To Len(x)
       b = Mid(x, a, 1)
          If IsNumeric(b) Then
            r = r & b
          Else
           s = s & b
          End If
Next a


'p--all capital values
'q--all small values
'r--all numberic values
's--all symbols

If k = 1 Then
  chootadon = p
  ElseIf k = 2 Then
  chootadon = q
    ElseIf k = 3 Then
    chootadon = r
      ElseIf k = 4 Then
      chootadon = s
        Else
        MsgBox ("please enter value between 1 to 4 ")
End If
  
End Function

-----------------------------------------------------------