Hallo Excel fans,
I have a programming problem I don’t seem to be able to solve on my own…?
What I have:
A row of cells each containing Data Validation. The user selects an item from the Data validation list. The adjacent cell determine, though an IF statement and the selected value, if a row should or should not be hidden.
The sheets Change event-routine is triggered and runs the following code which looks at each of these cells and hide/unhide the associated row depending if the outcome of the IF statement was TRUE or FALSE. Here is my code:
If Not Intersect(Target(1), PositionInputRange) Is Nothing Then
Application.ScreenUpdating = False
For i = 48 To 168 Step 2
If Range("H" & i) = True Then
Rows(i & ":" & i + 1).EntireRow.Hidden = True
Else
Rows(i & ":" & i + 1).EntireRow.Hidden = False
End If
Next
Application.ScreenUpdating = True
End If
The problem:
While the Change event routine is triggered and the code is executed, the rows are not hidden/unhidden accordingly.
If the code is added to a buttons Click event it runs fine…
Excel ver: 2002
OS: windows vista
Plenty thankx for your time...
I have a programming problem I don’t seem to be able to solve on my own…?
What I have:
A row of cells each containing Data Validation. The user selects an item from the Data validation list. The adjacent cell determine, though an IF statement and the selected value, if a row should or should not be hidden.
The sheets Change event-routine is triggered and runs the following code which looks at each of these cells and hide/unhide the associated row depending if the outcome of the IF statement was TRUE or FALSE. Here is my code:
If Not Intersect(Target(1), PositionInputRange) Is Nothing Then
Application.ScreenUpdating = False
For i = 48 To 168 Step 2
If Range("H" & i) = True Then
Rows(i & ":" & i + 1).EntireRow.Hidden = True
Else
Rows(i & ":" & i + 1).EntireRow.Hidden = False
End If
Next
Application.ScreenUpdating = True
End If
The problem:
While the Change event routine is triggered and the code is executed, the rows are not hidden/unhidden accordingly.
If the code is added to a buttons Click event it runs fine…
Excel ver: 2002
OS: windows vista
Plenty thankx for your time...