I need to know how, after fulfilling the condition, you can copy the corresponding range and paste on another sheet. That is, if row 13, after the iteration arrives, fulfills the condition, the defined range of row 13 is copied and copied in the defined range of another sheet.
Sub CondicionalTopTxx()
Dim OrigenHoja As Excel.Worksheet, _
DestinoHoja As Excel.Worksheet, _
a As Integer
Set OrigenHoja = Worksheets("TNC D")
Set DestinoHoja = Worksheets("TNC B")
OrigenHoja.Activate
For a = 2 To 40
Set valor = OrigenHoja.Cells(a, 17)
If valor.Value < 4 Then
Range("O14:S16").Copy
DestinoHoja.Range("O14:S16").PasteSpecial xlPasteAll
Application.CutCopyMode = False
End If
Next
End Sub
How can I select only the range that meets the condition? Thanks.