Lef_pl
01-26-2014, 12:29 PM
Hi,
I'm newbie in VBA but I would like to write a macro which search phrase from column B (for example 12345) in cells from column A (DDK912345087D).
Could you please advise?
Right now I have something like this.
Sub Makro1()
Dim rng As Range, cell As Range
Dim arrList() As String, lngCnt As Long
Set rng = Range("B1:B10")
lngCnt = 0
For Each cell In rng
ReDim Preserve arrList(lngCnt)
arrList(lngCnt) = cell.Text
lngCnt = lngCnt + 1
Next
ActiveSheet.Range("A:A").AutoFilter Field:=1, Criteria1:= _
"=*arrList*", Operator:=xlAnd
End Sub
Macro is showing cells from column A containing "arrList" phrase :(.
Later I would like to copy results to another worksheet but my biggest concern is that filter issue.
I'm newbie in VBA but I would like to write a macro which search phrase from column B (for example 12345) in cells from column A (DDK912345087D).
Could you please advise?
Right now I have something like this.
Sub Makro1()
Dim rng As Range, cell As Range
Dim arrList() As String, lngCnt As Long
Set rng = Range("B1:B10")
lngCnt = 0
For Each cell In rng
ReDim Preserve arrList(lngCnt)
arrList(lngCnt) = cell.Text
lngCnt = lngCnt + 1
Next
ActiveSheet.Range("A:A").AutoFilter Field:=1, Criteria1:= _
"=*arrList*", Operator:=xlAnd
End Sub
Macro is showing cells from column A containing "arrList" phrase :(.
Later I would like to copy results to another worksheet but my biggest concern is that filter issue.