mardi 27 avril 2021

Excel VBA IF statement returning false results

I have set a and b as variables and as true / false based on whether they appear in a row.

I want to create an IF statement that states that if b is true but a is false then it should enter this into a sheet. However, the code brings results even when a is true. What could be wrong?

If Not a Then
If b = True Then
RecordNextRow = RecordNextRow + 1
RecordNextRow = x
End If
End If`

I also tried 
If (a = False) And (b = True)Then
RecordNextRow = RecordNextRow + 1
RecordNextRow = x
End If
End If

Aucun commentaire:

Enregistrer un commentaire