Code:
Sub CondCopy()
ThisWorkbook.Activate
Worksheets.Add(After:=Worksheets(Worksheets.Count)).Name = "MySheet"
Sheets("JCR").Select
Rows(1).Copy
Sheets("MySheet").Activate
Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.Font.Bold = True
Application.CutCopyMode = False
Sheets("JCR").Select
RowCount = Cells(Cells.Rows.Count, "A").End(xlUp).Row
For i = 1 To RowCount
Range("A" & i).Select
Check_value = ActiveCell
If Check_value <> 0 Then
ActiveCell.EntireRow.Copy
Sheets("MySheet").Select
RowCount = Cells(Cells.Rows.Count, "A").End(xlUp).Row
Range("A" & RowCount + 1).Select
ActiveSheet.Paste
Sheets("MySheet").Select
End If
Next
End Sub
hi. this is my code. i want to copy entire row to sheet called "MySheet" from sheet "JCR". the copy entire row is base on a condition that if the cell value in column A is not equal to zero then copy entire row and paste it in "MySheet" from row 2. I make this code and run this code and it goes into infinite loop. plz some help me because i cannot see and understand what and where is it going wrong.