DutchKevin
Board Regular
- Joined
- Apr 13, 2011
- Messages
- 133
- Office Version
- 365
- Platform
- Windows
Hi, a quick question on principle.
What is the better option in Excel VBA when it comes to testing a whole column for some conditions.
Nesting the If functions in a logic way? Narrowing down to cells that matter
If Cell <> ""
If Cell<> "TestText"
If Len(Cell) > 5
' code here
End If
End If
End If
Or combine them into one and test all cells for all conditions
If Cell <> "" AND Cell <> "TestText" AND Len(Cell) > 5
' code here too
End if
Thanks
What is the better option in Excel VBA when it comes to testing a whole column for some conditions.
Nesting the If functions in a logic way? Narrowing down to cells that matter
If Cell <> ""
If Cell<> "TestText"
If Len(Cell) > 5
' code here
End If
End If
End If
Or combine them into one and test all cells for all conditions
If Cell <> "" AND Cell <> "TestText" AND Len(Cell) > 5
' code here too
End if
Thanks