Hi all,
I am stuck on a code and need your help. How do I formulate code that if selection on cell#A3 in sheet1 equals "Yes" then display rows 4-34 on sheet2, and if selection on cell#A3 in sheet1 equals "No" then hide rows 4-34 on sheet2.
I was able to get vba to work for the same worksheet. but I am struggling with different worksheet selection. Can you please help? below is the vba code i built thus far.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$3" Then
If Target = "Yes" Then
AddForms
ElseIf Target = "No" Then
HideForms
End If
End If
End Sub
-------------------------------
Sub AddForms()
Rows("4:34").Select
Selection.EntireRow.Hidden = False
Range("A1").Select
End Sub
-------------------------------
Sub HideForms()
Rows("4:34").Select
ActiveWindow.SmallScroll Down:=9
Rows("4:34").Select
Selection.EntireRow.Hidden = True
Range("A1").Select
End Sub
I am stuck on a code and need your help. How do I formulate code that if selection on cell#A3 in sheet1 equals "Yes" then display rows 4-34 on sheet2, and if selection on cell#A3 in sheet1 equals "No" then hide rows 4-34 on sheet2.
I was able to get vba to work for the same worksheet. but I am struggling with different worksheet selection. Can you please help? below is the vba code i built thus far.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$3" Then
If Target = "Yes" Then
AddForms
ElseIf Target = "No" Then
HideForms
End If
End If
End Sub
-------------------------------
Sub AddForms()
Rows("4:34").Select
Selection.EntireRow.Hidden = False
Range("A1").Select
End Sub
-------------------------------
Sub HideForms()
Rows("4:34").Select
ActiveWindow.SmallScroll Down:=9
Rows("4:34").Select
Selection.EntireRow.Hidden = True
Range("A1").Select
End Sub