Friday, 31 August 2012

Macro To Pull Out All Search Item Records From One Sheet To Another

Macro To Pull Out All Search Item Records From One Sheet To Another

Sub SearchPull()
Dim x As Integer
Dim Y As Integer
Dim Z As Integer
Dim A As Integer
Dim c As String
A = 1
c = InputBox(" Enter Search String ")
Sheets.ADD.Name = c
For Z = 1 To 26
For x = 1 To 100

If InStr(LCase(Sheets("AAA").Cells(x, Z)), LCase(c)) Then
A = A + 1

For Y = 1 To 26
Sheets(c).Cells(A, Y) = Sheets("AAA").Cells(x, Y)
Sheets(c).Cells(1, Y) = Sheets("AAA").Cells(1, Y)
Next Y

End If
Next x
Next Z
End Sub

No comments:

Post a Comment

Follow Me by Email

ExcelKingdom-Popular Posts

ExcelKingdom-Random Posts