View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
MArcus MArcus is offline
external usenet poster
 
Posts: 22
Default Copying an Entire row using an IF Statement

sorry for reposting this

But i need to be able to use the <= = commands with this
code is this possible.
Sub test()
Dim i As Long, rng As Range, str As String

str = "1st Quarter Quarter"
Set rng = Worksheets("Sheet2").Rows(1)

With Worksheets("Data")
For i = 2 To .Cells(Rows.Count, 2).End(xlUp).Row
If StrComp(.Cells(i, 2).Value, str) = 1 Then
.Rows(i).Copy rng
Set rng = rng.Offset(1)
End If
Next
End With
End Sub