Hi I'm trying to run a macro based on another cell value. I simply want to hide rows based on a dropdown value from another cell. Is this possible. I have working code that is hiding rows, but it is not being triggered when the value is selected I have to manually run the macro. Could someone help me?
Code:
Private Sub worksheet_change(ByVal target As Range)
Set target = Range("B1")
If target.value = "Delete" Then
Call Macro1
End If
End Sub
Sub Macro1
If Range("B1").Value="Delete" Then
Rows("3:4").EntireRow.Hidden = True .......etc
The sub macro1 is working but not being triggered by the private sub on the worksheet
Code:
Private Sub worksheet_change(ByVal target As Range)
Set target = Range("B1")
If target.value = "Delete" Then
Call Macro1
End If
End Sub
Sub Macro1
If Range("B1").Value="Delete" Then
Rows("3:4").EntireRow.Hidden = True .......etc
The sub macro1 is working but not being triggered by the private sub on the worksheet