Hello,
I have a small problem with an For/If combination.
The macro is supposed to check the Data sheet for 2 criteria but its not working the way I want it to. Basically I don't know how to tell the macro to count/go on if not both IF statements are true.
Thank you
I have a small problem with an For/If combination.
The macro is supposed to check the Data sheet for 2 criteria but its not working the way I want it to. Basically I don't know how to tell the macro to count/go on if not both IF statements are true.
Thank you
Code:
For icount = 2 To lngDrange
If Worksheets("Data").Cells(icount, 5) = cboPc.Value Then
If Worksheets("Data").Cells(icount, 2) = lngLJH Then
wks2.Range("A" & lngRange & ":F" & lngRange).Copy Destination:=wks1.Cells(lngTlast, 1)
wks1.Cells(lngTlast, 7) = Me.txtLjh.Value
wks1.Cells(lngTlast, 7).NumberFormat = "General"
Exit For
End If
End If
Next icount