A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data
The code is not a macro (it is Private, it has an argument Target and it is not stored in a standard module but in the worksheet module.
You change the name of the procedure; that won't work in this situation. It must be named Worksheet_Change instead of HideRows.
Remarks:
- ActiveSheet.Activate is superfluous - delete that line.
- Range(Target.Address) is needlessly long - just use Target.
- The code can be shortened to Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect(Range("F42"), Target) Is Nothing Then Rows("43:45").EntireRow.Hidden = (Range("F42").Value = "No") End If End Sub