The problem is likely to be this line:
x = Range("L" & i).Value + Range("M" & i).Value + Range("N" & i).Value
1. If there's text in one of the cells it can't do an addition (type mismatch).
2. Summing the 3 cells may not tell you if all three values are 0; the 3 values could, for example, be 1, -1, 0.
You may be better off with the likes of:
If .Range("L" & i).Value = 0 And .Range("M" & i).Value = 0 And .Range("N" & i).Value = 0 Then
but that will not hide rows where there is text in one of those cells - maybe that's what you want?
If you want to hide those rows with text in one or more of those cells too, then perhaps:
If (.Range("L" & i).Value = 0 Or TypeName(.Range("L" & i).Value) = "String") And (.Range("M" & i).Value = 0 Or TypeName(.Range("M" & i).Value) = "String") And (.Range("N" & i).Value = 0 Or TypeName(.Range("N" & i).Value) = "String") Then
If you only want to hide rows where the three cells are "without any values" then it could be as simple as:
If Application.CountBlank(.Range("L" & i & ":N" & i)) = 3 Then
In full (you don't need the x variable):
Sub moon()
Dim i As Long
Dim ws As Worksheet
Application.ScreenUpdating = False
With ThisWorkbook
For Each ws In .Worksheets
Select Case ws.Name
Case "??", "??", "??", "?? ???." '<<<<you will need to correct this!!
Case Else
With ws
For i = 5 To 250
If Application.CountBlank(.Range("L" & i & ":N" & i)) = 3 Then
.Rows(i).Hidden = True
Else
.Rows(i).Hidden = False
End If
Next i
End With
End Select
Next ws
End With
Application.ScreenUpdating = True
End Sub
3. You must have a dot before each Range reference and before each Rows reference within the With ws ... End With. Otherwise the wrong sheet will be processed (only the active sheet).
4. I suspect you want that last line to be:
Application.ScreenUpdating = True
5. Whichever If phrase you want to use, you can shorten your code to the likes of:
Sub moon()
Dim i As Long
Dim ws As Worksheet
Application.ScreenUpdating = False
With ThisWorkbook
For Each ws In .Worksheets
Select Case ws.Name
Case "??", "??", "??", "?? ???." '<<<<you will need to correct this!!
Case Else
With ws
For i = 5 To 250
.Rows(i).Hidden = Not (Application.CountBlank(.Range("L" & i & ":N" & i)) = 3)
Next i
End With
End Select
Next ws
End With
Application.ScreenUpdating = True
End Sub
6. Finally, note that the Case statement above hasn't properly copied your sheet names so you'll need to correct that.