W
Wanna Learn
Hello I have two macros, separately they work but when I combined them into
one macro it does not work. Below is the macro combined. Thank you for help
Private Sub Worksheet_Change(ByVal Target As Range)
'With Target
'If .Address <> "$B$28" Then Exit Sub
'If .Value = " Agreement" Then
' Rows(32).Hidden = False
'Rows(33).Hidden = True
' Rows(39).Hidden = True
'ElseIf .Value = "Master Agreement" Then
' Rows(32).Hidden = True
' Rows(33).Hidden = False
'ElseIf (Range("S4") = "Yes") Then
'Sheets("Discount
").Range("90:90,93:93,95:95,129:129,159:159,161:161,162:162,164:164,165:165,166:166,168:168,171:171,306:306,308:308,343:343,345:345,350:350").EntireRow.Hidden = True
'Else
'Sheets("Discount
").Range("90:90,93:93,95:95,129:129,159:159,161:161,162:162,164:164,165:165,166:166,168:168,171:171,306:306,308:308,343:343,345:345,350:350").EntireRow.Hidden = False
'End If
'End With
'End Sub
one macro it does not work. Below is the macro combined. Thank you for help
Private Sub Worksheet_Change(ByVal Target As Range)
'With Target
'If .Address <> "$B$28" Then Exit Sub
'If .Value = " Agreement" Then
' Rows(32).Hidden = False
'Rows(33).Hidden = True
' Rows(39).Hidden = True
'ElseIf .Value = "Master Agreement" Then
' Rows(32).Hidden = True
' Rows(33).Hidden = False
'ElseIf (Range("S4") = "Yes") Then
'Sheets("Discount
").Range("90:90,93:93,95:95,129:129,159:159,161:161,162:162,164:164,165:165,166:166,168:168,171:171,306:306,308:308,343:343,345:345,350:350").EntireRow.Hidden = True
'Else
'Sheets("Discount
").Range("90:90,93:93,95:95,129:129,159:159,161:161,162:162,164:164,165:165,166:166,168:168,171:171,306:306,308:308,343:343,345:345,350:350").EntireRow.Hidden = False
'End If
'End With
'End Sub