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
--
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
--