oldmaninla
New Member
I have a simple macro that runs fine (hides zero rows) but at the end of the macro I get an error "macro run-time error '13' type mismatch".
Here is my macro:
>>> use code - tags <<<
Debug takes me to the line: "If ws.Range("U" & M).Value = "no show" Then"
Any ideas why I get the error or better yet, how to fix the macro.
The value in the worksheets use this formula: =IF(ABS(SUMPRODUCT(E94:S94))=0,"no show","show")
There can be 300 lines in a worksheet or 250 lines.
Thank you
Here is my macro:
>>> use code - tags <<<
Code:
Sub HideZeroRows()
Dim M As Long, LastRow As Long
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
LastRow = ws.Range("U400").End(xlUp).Row
For M = LastRow To 7 Step -1
If ws.Range("U" & M).Value = "no show" Then
ws.Range("U" & M).EntireRow.Hidden = True
End If
Next M
Next ws
End Sub
Any ideas why I get the error or better yet, how to fix the macro.
The value in the worksheets use this formula: =IF(ABS(SUMPRODUCT(E94:S94))=0,"no show","show")
There can be 300 lines in a worksheet or 250 lines.
Thank you
Last edited by a moderator: