Hello,
Would greatly appreciate some help on this issue. I have a multi worksheet book for quoting. There are a number of conditional elements that with some trial and error are all working except one thing. I have two change type events that need to trigger on the same worksheet, one changes elements within the worksheet and the other is meant to hide rows on other worksheets based on a condition in this worksheet. After learning I could not have two same event types on the same worksheet, i have tried combining based on what I could research. The code is just below. The part that is listed as the second block works fine. the top part does not. it gives no error message that i can see but nor am I able to step through the code in the vba module. Originally I had tried saying <> "Netsuite" and having the hide True come first but as that wasn't doing anything, tried this other way but same result. I had also originally tried using Row instead of Range but since not contiguous thought needed to be range.
Would greatly appreciate some help on this issue. I have a multi worksheet book for quoting. There are a number of conditional elements that with some trial and error are all working except one thing. I have two change type events that need to trigger on the same worksheet, one changes elements within the worksheet and the other is meant to hide rows on other worksheets based on a condition in this worksheet. After learning I could not have two same event types on the same worksheet, i have tried combining based on what I could research. The code is just below. The part that is listed as the second block works fine. the top part does not. it gives no error message that i can see but nor am I able to step through the code in the vba module. Originally I had tried saying <> "Netsuite" and having the hide True come first but as that wasn't doing anything, tried this other way but same result. I had also originally tried using Row instead of Range but since not contiguous thought needed to be range.
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$H$3" Then
If Target.Value = "Netsuite" Then
Worksheets("Sheet6").Range("A32,A37").EntireRow.Hidden = False
Worksheets("Sheet7").Range("A35,A40,A44").EntireRow.Hidden = False
Worksheets("Sheet8").Range("A38,A45,A48").EntireRow.Hidden = False
Worksheets("Sheet9").Range("A44,A50,A53,A54").EntireRow.Hidden = False
Worksheets("Sheet10").Range("A7,A52:54").EntireRow.Hidden = False
Else
Worksheets("Sheet6").Range("A32,A37").EntireRow.Hidden = True
Worksheets("Sheet7").Range("A35,A40,A44").EntireRow.Hidden = True
Worksheets("Sheet8").Range("A38,A45,A48").EntireRow.Hidden = True
Worksheets("Sheet9").Range("A44,A50,A53,A54").EntireRow.Hidden = True
Worksheets("Sheet10").Range("A7,A52:54").EntireRow.Hidden = True
End If
End If
' *** Next block*** [this part below seems to work just fine]
If Target.Address = "$B$11" Then
Range("b13:b22,b25:b31,B34:b38,j25:j31,j34:j38,k11,k13:k22,k25:k31,k34:k38").Value = ""
End If
End Sub