Desu Nota from Columbus
Well-known Member
- Joined
- Mar 17, 2011
- Messages
- 556
I'm trying to learn to write VB code and am currently trying to figure out how to turn =if(and()) statements into VB code (also nestedif)
Criteria: If A1>=.85, hide rows 2-10
If A1<.85, hide rows 10-20
I don't know how to link both if statements.
Is this correct?
Criteria: If A1>=.85, hide rows 2-10
If A1<.85, hide rows 10-20
I don't know how to link both if statements.
Code:
Sub testing_1()
If Sheet1.Range("A1") >= .85 Then
Range("2:10").EntireRow.Hidden = True
Else
If Sheet1.Range("a1") < .85 then
Range("10:20").EntireRow.Hidden = True
End If
End Sub
Is this correct?