Good day all,
I have a quick question: I am running a loop which copies certain cells from rows according to an IF statement from a different worksheet.
My code runs from i = 9 to i = 61 but I need it to ignore row 21, as it meets the IF condition yet I still want it to be ignored, how would I go about doing so?
Thanks in advance
I have a quick question: I am running a loop which copies certain cells from rows according to an IF statement from a different worksheet.
My code runs from i = 9 to i = 61 but I need it to ignore row 21, as it meets the IF condition yet I still want it to be ignored, how would I go about doing so?
Thanks in advance
Code:
Sub CopyTasks ()
Application.ScreenUpdating = False
Dim i As Long
Dim r As Long
r = 12
For i = 9 To 61
With Sheets("TimeSheet")
If .Cells(i, "K").Value >= 0.1 And .Cells(i, "K").Value <= 24 Then
.Cells(i, "B").Resize(, 2).Copy: Sheets("Monday").Cells(r, "C").PasteSpecial xlValues
.Cells(i, "E").Copy: Sheets("Monday").Cells(r, "E").PasteSpecial xlValues
.Cells(i, "G").Copy: Sheets("Monday").Cells(r, "I").PasteSpecial xlValues
r = r + 5
End If
End With
Next
Application.ScreenUpdating = True
End Sub
Last edited: