santoshloka
Board Regular
- Joined
- Aug 31, 2017
- Messages
- 125
Private Sub CommandButton1_Click()
a = Worksheets("Sheet1").Cells(Rows.Count, 1).End(xlUp).Row
For i = 2 To a
If Worksheets("sheet1").Cells(i, 6).Value = "x" Then
Worksheets("Sheet1").Rows(i).Copy
Worksheets("Sheet1").Cells.field = 10
b = Worksheets("sheet1").Cells(Rows.Count, 1).End(xlUp).Row
Worksheets("Sheet1").Cells(b + 1, 1).Select
ActiveSheet.Paste
Worksheets("sheet1").Activate
End If
Next i
Application.CutCopyMode = False
ThisWorkbook.Worksheets("sheet1").Cells(1, 1).Select
End Sub
a = Worksheets("Sheet1").Cells(Rows.Count, 1).End(xlUp).Row
For i = 2 To a
If Worksheets("sheet1").Cells(i, 6).Value = "x" Then
Worksheets("Sheet1").Rows(i).Copy
Worksheets("Sheet1").Cells.field = 10
b = Worksheets("sheet1").Cells(Rows.Count, 1).End(xlUp).Row
Worksheets("Sheet1").Cells(b + 1, 1).Select
ActiveSheet.Paste
Worksheets("sheet1").Activate
End If
Next i
Application.CutCopyMode = False
ThisWorkbook.Worksheets("sheet1").Cells(1, 1).Select
End Sub