C
Chad
Hi All
The following code works well in XL 2K but not 2003. I have a
combobox with 7 categories. Test 1 –5, “All” and “Show 123”. Does
anyone have any idea how I might produce the same code in XL 2003.
Thanks in advance.
Chad
Private Sub ComboBox1_Change()
Dim lw As Long
Application.ScreenUpdating = False
Range("A7:A100").EntireRow.Hidden = False
lw = Range("A" & Rows.Count).End(xlUp).Row
' If Range(
For i = lw To 2 Step -1
If Range("A" & i).Value = ComboBox1.Value Then
Range("A" & i).EntireRow.Hidden = True
ElseIf ComboBox1.Value = "All" Then
Range("A7:A100").EntireRow.Hidden = False
ElseIf ComboBox1.Value = "Show 123" Then
If Range("A" & i).Value = "Test4" Or _
Range("A" & i).Value = "Test5" Then
Range("A" & i).EntireRow.Hidden = True
End If
End If
Next i
Calculate
Application.ScreenUpdating = True
End Sub
The following code works well in XL 2K but not 2003. I have a
combobox with 7 categories. Test 1 –5, “All” and “Show 123”. Does
anyone have any idea how I might produce the same code in XL 2003.
Thanks in advance.
Chad
Private Sub ComboBox1_Change()
Dim lw As Long
Application.ScreenUpdating = False
Range("A7:A100").EntireRow.Hidden = False
lw = Range("A" & Rows.Count).End(xlUp).Row
' If Range(
For i = lw To 2 Step -1
If Range("A" & i).Value = ComboBox1.Value Then
Range("A" & i).EntireRow.Hidden = True
ElseIf ComboBox1.Value = "All" Then
Range("A7:A100").EntireRow.Hidden = False
ElseIf ComboBox1.Value = "Show 123" Then
If Range("A" & i).Value = "Test4" Or _
Range("A" & i).Value = "Test5" Then
Range("A" & i).EntireRow.Hidden = True
End If
End If
Next i
Calculate
Application.ScreenUpdating = True
End Sub