copy rows to new page
Hi david,
Make sure to test and to adjust as needed ...
Sub Macro1()
Dim i As Integer
Dim LastRow As Integer
LastRow = Cells(Cells.Rows.Count, "C").End(xlUp).Row
For i = 1 To LastRow
Range("C" & i).Select
If ActiveCell.Value = "OPEN" Then
ActiveCell.EntireRow.Copy
Sheets("OPEN").Select
Range("A1").Select
If Range("A1").Value < "" Then
ActiveCell.Offset(1, 0).Select
ActiveSheet.Paste
Else
ActiveSheet.Paste
End If
Range("C" & i).Select
Sheets("DATA").Select
Range("C" & i).Select
ElseIf ActiveCell.Value = "CLOSE" Then
ActiveCell.EntireRow.Copy
Sheets("CLOSE").Select
Range("A1").Select
If Range("A1").Value < "" Then
ActiveCell.Offset(1, 0).Select
ActiveSheet.Paste
Else
ActiveSheet.Paste
End If
Range("C" & i).Select
Sheets("DATA").Select
Range("C" & i).Select
End If
Application.CutCopyMode = xlCut
Next i
End Sub
HTH
Cheers
Carim
|