Saturday, 1 September 2012

Macro To Pull Out Strings Exact Match With Desired String


Macro To Pull Out Strings Exact Match With Desired String
Eg: Names exact match with "T P REDDY"

Sub SerchMid()
Dim x As Integer
Dim Y As Integer
Dim Z As Integer
Dim b As Integer
Dim a As String
Dim d As String

b = 1
On Error GoTo TPR:
d = InputBox("Enter Your Name: ")
a = InputBox("Hai" & " " & d & " " & "Enter Your Search Sring :")
Y = InputBox("Enter Search Colno :")
Z = InputBox("Enter Search Results Colno :")
Cells(1, Z) = " SEARCH RESULTS"
Cells(1, Z).Font.Bold = True

For x = 1 To 100
If Mid(LCase(Cells(x, Y)), 1, Len(a)) = LCase(a) And Len(LCase(Cells(x, Y))) = Len(a) Then
b = b + 1
Cells(b, Z) = Cells(x, Y)
End If
Next x

TPR:

End Sub

2 comments:

  1. Very Nice and Smart Macro ...More Use full...
    Thank You Mr.Reddy..Nice Information.

    ReplyDelete
    Replies
    1. Thank You....Keep on following my Blog.....

      Delete

Hi User, Thank You for Visiting My Blog. Please Post Your Feedback/Comments/Query.

Subscribe to Blog Posts by Email

ExcelKingdom-Popular Posts

ExcelKingdom-Random Posts