I
Imran J Khan
Hi,
I know there are plenty of posts with similar issues, but I have not been
able to find one that helps me. I don't know what part of the code below is
not compatible with 2003.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim ModelSheet As String
Dim R As Long
Application.ScreenUpdating = False
'Setting value for string ModelSheet according to column of active cell
Select Case ActiveCell.Offset(-1, 0).Column
Case 2
ModelSheet = "Core Model"
Case 3
ModelSheet = "Model 1"
Case 4
ModelSheet = "Model 2"
Case 5
ModelSheet = "Model 3"
Case 6
ModelSheet = "Model 4"
Case 7
ModelSheet = "Model 5"
Case 8
ModelSheet = "Model 6"
End Select
'Hidding or unhidding row where cell value is 0
R = ActiveCell.Offset(2, 0).Row
If ActiveCell.Offset(-1, 0).Value = "0" Then
Worksheets(ModelSheet).Rows(R).Hidden = True
ElseIf ActiveCell.Offset(-1, 0).Value > "0" Then
Worksheets(ModelSheet).Rows(R).Hidden = False
End If
Application.ScreenUpdating = True
End Sub
I would appreciate any input
Imran
I know there are plenty of posts with similar issues, but I have not been
able to find one that helps me. I don't know what part of the code below is
not compatible with 2003.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim ModelSheet As String
Dim R As Long
Application.ScreenUpdating = False
'Setting value for string ModelSheet according to column of active cell
Select Case ActiveCell.Offset(-1, 0).Column
Case 2
ModelSheet = "Core Model"
Case 3
ModelSheet = "Model 1"
Case 4
ModelSheet = "Model 2"
Case 5
ModelSheet = "Model 3"
Case 6
ModelSheet = "Model 4"
Case 7
ModelSheet = "Model 5"
Case 8
ModelSheet = "Model 6"
End Select
'Hidding or unhidding row where cell value is 0
R = ActiveCell.Offset(2, 0).Row
If ActiveCell.Offset(-1, 0).Value = "0" Then
Worksheets(ModelSheet).Rows(R).Hidden = True
ElseIf ActiveCell.Offset(-1, 0).Value > "0" Then
Worksheets(ModelSheet).Rows(R).Hidden = False
End If
Application.ScreenUpdating = True
End Sub
I would appreciate any input
Imran