i have the following code, the first part which is show/hide rows works fine. the second part of the code is not working very well. is suppose to hide "LOAD" (1 until 60) whenever there is a number in cell D12:D71.
it used to work really nice in another sheet but now just hides several of them i don't know why.
can you please help me.
p.s. TMS helped me in the past with this code
code for excell file is 12341
Option Explicit
Private Sub Worksheet_change(ByVal Target As Range)
If Not Intersect(Target, Range("L1")) Is Nothing Then
Application.ScreenUpdating = False
Rows("12:72").EntireRow.Hidden = False
Select Case InStr(UCase(Range("L1")), "WAY DB") > 0
Case True: Rows(Left(Range("L1"), --(InStr(Range("L1"), " ") - 1)) + 12 & ":72").EntireRow.Hidden = True
End Select
Select Case Range("L1").Value
Case Is = "UNHIDE": Rows("13:72").EntireRow.Hidden = False
Case Else
Application.ScreenUpdating = True
End Select
End If
Dim i As Long
Const iMin As Long = 12
Const iMax As Long = 71
For i = iMin To iMax
If Range("D" & i).Value > "1" Then
ActiveSheet.Shapes("load" & i - 2).Visible = True
Else
ActiveSheet.Shapes("load" & i - 2).Visible = False
End If
Next 'i
End Sub
this my excel file
exe1.xlsm
Bookmarks