I need to record a macro that will work on an entire row only if one of the cells in that row is answering a condition that I choose.
is there any way to record a macro that way?
thanks
I need to record a macro that will work on an entire row only if one of the cells in that row is answering a condition that I choose.
is there any way to record a macro that way?
thanks
Sub Celltest()
For Each cel In Range("B1:B250").Cells
If cel.value = (YOUR CONDITION) Then
MsgBox "CONDITION OK"
ELSE
MsgBox "CONDITION NOT OK"
END IF
Next
End Sub
I don't think there is a way to record that.
However you can record your macro and later edit the code (press Alt+F1) and add your condition.
Record the macro. First select the entire row you want to edit and then do your stuff as if the condition is met. After you recorded your macro edit the code and add your condition. This link may help you.
If you have an attempt to show don't hesitate. I'm glad to help