Hello,
Hope you are well.
I have a simple macro that hides rows 120:256 if cell A2' value is ELK and hides rows 26:115 if A2 is LHP or KDP. The macro works. The values in A2 comes from a cell on another sheet with a pivot table that give the values ELK, LHP or KDP if I choose it with a slicer.
I tried activating the macro with a sheet change event, but it does not want to run.
I also tried:
But it did not work.
I also placed the macro code directly between the Target change code, but also no joy.
Can someone please give me advice on why the code will not work?
Regards,
Hope you are well.
I have a simple macro that hides rows 120:256 if cell A2' value is ELK and hides rows 26:115 if A2 is LHP or KDP. The macro works. The values in A2 comes from a cell on another sheet with a pivot table that give the values ELK, LHP or KDP if I choose it with a slicer.
I tried activating the macro with a sheet change event, but it does not want to run.
Code:
If Target.Address = A2 then
Call hidRowsMaps
End If
I also tried:
Code:
If Not Intersect(Target.Cell(2, 1), Sheet1.Range("A2")) Is Nothing Then
Application.Run("hidRowsMaps()")
End If
I also placed the macro code directly between the Target change code, but also no joy.
Can someone please give me advice on why the code will not work?
Regards,