Fejlmeddelse i macro skjul
Jeg har en Macro til at skjule tomme linier. Men kan ikke rigtig få den til at virke længere. Jeg får denne fejlmeddelese (Run-time error '1004': kan ikke angive egenskaben Hidden for klassen Rage.)Her er min macro :
Sub Skjul()
Application.ScreenUpdating = False
Dim a As Long 'a er en tækker der tæller over rækkerne
For a = 3 To 68
If Cells(a, 2).Value = "" Or Cells(a, 2).Value = "0" Then
Cells(a, 2).Select
ActiveCell.EntireRow.Hidden = True
End If
Next a
For b = 70 To 135
If Cells(b, 2).Value = "" Or Cells(b, 2).Value = "0" Then
Cells(b, 2).Select
ActiveCell.EntireRow.Hidden = True
End If
Next b
For c = 137 To 202
If Cells(c, 2).Value = "" Or Cells(c, 2).Value = "0" Then
Cells(c, 2).Select
ActiveCell.EntireRow.Hidden = True
End If
Next c
For d = 204 To 269
If Cells(d, 2).Value = "" Or Cells(d, 2).Value = "0" Then
Cells(d, 2).Select
ActiveCell.EntireRow.Hidden = True
End If
Next d
For e = 271 To 336
If Cells(e, 2).Value = "" Or Cells(e, 2).Value = "0" Then
Cells(e, 2).Select
ActiveCell.EntireRow.Hidden = True
End If
Next e
For f = 338 To 403
If Cells(f, 2).Value = "" Or Cells(f, 2).Value = "0" Then
Cells(f, 2).Select
ActiveCell.EntireRow.Hidden = True
End If
Next f
For g = 405 To 470
If Cells(g, 2).Value = "" Or Cells(g, 2).Value = "0" Then
Cells(g, 2).Select
ActiveCell.EntireRow.Hidden = True
End If
Next g
For h = 472 To 537
If Cells(h, 2).Value = "" Or Cells(h, 2).Value = "0" Then
Cells(h, 2).Select
ActiveCell.EntireRow.Hidden = True
End If
Next h
For i = 539 To 604
If Cells(i, 2).Value = "" Or Cells(i, 2).Value = "0" Then
Cells(i, 2).Select
ActiveCell.EntireRow.Hidden = True
End If
Next i
For j = 606 To 671
If Cells(j, 2).Value = "" Or Cells(j, 2).Value = "0" Then
Cells(j, 2).Select
ActiveCell.EntireRow.Hidden = True
End If
Next j
For k = 673 To 738
If Cells(k, 2).Value = "" Or Cells(k, 2).Value = "0" Then
Cells(k, 2).Select
ActiveCell.EntireRow.Hidden = True
End If
Next k
For l = 740 To 805
If Cells(l, 2).Value = "" Or Cells(l, 2).Value = "0" Then
Cells(l, 2).Select
ActiveCell.EntireRow.Hidden = True
End If
Next l
For m = 807 To 872
If Cells(m, 2).Value = "" Or Cells(m, 2).Value = "0" Then
Cells(m, 2).Select
ActiveCell.EntireRow.Hidden = True
End If
Next m
For n = 874 To 939
If Cells(n, 2).Value = "" Or Cells(n, 2).Value = "0" Then
Cells(n, 2).Select
ActiveCell.EntireRow.Hidden = True
End If
Next n
For o = 941 To 1006
If Cells(o, 2).Value = "" Or Cells(o, 2).Value = "0" Then
Cells(o, 2).Select
ActiveCell.EntireRow.Hidden = True
End If
Next o
Application.ScreenUpdating = True
' Skjul Makro
' Makro indspillet 21-09-2006 af Niki
'
'
End Sub