Hi
I worte this VBA code, should be easy but nothing is today :-(
I want to hide row 35:38, if cell D34 is text "Nej"
What am I doing wrong ??
/ Kristian
[CODE]
Sub HideRows()
Dim oSheet As Excel.Worksheet
Set oSheet = ActiveWorkbook.Sheets("Info om virksomheden")
ActiveSheet.Unprotect "ERV-2017"
If Target.Address = "$D$34" Then
If Target.Value = "Nej" Then
ActiveSheet.Rows("35:38").EntireRow.Hidden = True
Else
Set oSheet = ActiveWorkbook.Sheets("Info om virksomheden")
ActiveSheet.Rows("35:38").EntireRow.Hidden = False
End If
End If
End Sub
[/ CODE]
Bookmarks