Find a specific number in b column

K

KOBE

I want to find all "200401" in column B , then copy these row to new sheet
here is my code
I can find the cell which contain "200401",but I don't know how to copy that
entire row to new sheet

_____________________________________________________________________-

mnCount = 1

Set NewSheet = Sheets.Add(Type:=xlWorksheet) ' create new sheet

For i = 1 To Sheets.count

With Sheets(i).Range("b1:b5000")

Set c = .Find("200401", LookIn:=xlValues)

If Not c Is Nothing Then
firstAddress = c.Address
Do
NewSheet.Rows(mnCount).Value = c.Rows() ' this code
is wrong,I don't know how to select the entire row
mnCount = mnCount + 1
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address
<>firstAddress
End If
End With

mnCount = mnCount + 1
Next i



--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top