Friday, August 31, 2012

How to Extract a Search Item from a Range and Move to a Desired Column in Excel with VBA

VBA Macro to Pull Out a Search Item from a Range and Move to the Desired Column in Excel
Sub SearchMultipleCol()

Dim x As Integer
Dim Y As Integer
Dim Z As Integer
Dim A As Integer
Dim c As String

c = InputBox("Enter Search String")
Z = InputBox("Enter Results Column No.")

For Y = 1 To 5

For x = 1 To 100
If InStr(LCase(Cells(x, Y)), LCase(c)) Then

A = A + 1
Cells(A, Z) = Cells(x, Y)

End If
Next x

Next Y
End Sub

Thanks,Tamatam

No comments:

Post a Comment

Hi User, Thank You for visiting My Blog. Please post your genuine Feedback or comments only related to this Blog Posts. Please do not post any Spam comments or Advertising kind of comments which will be Ignored.

Featured Post from this Blog

How to compare Current Snapshot Data with Previous Snapshot in Power BI

How to Dynamically compare two Snapshots Data in Power BI Scenario: Suppose, we have a sample Sales data, which is stored with Monthly Snaps...

Popular Posts from this Blog