VBA/Excel/Access/Word/Excel/Cell Protected

Материал из VB Эксперт
Версия от 15:47, 26 мая 2010; Admin (обсуждение | вклад) (1 версия)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

Protected cell error

   <source lang="vb">

Sub ResetValues2()

   For i = 1 To Worksheets.Count
   On Error GoTo errorHandler
       For Each n In Worksheets(i).UsedRange
           If IsNumeric(n) Then
               If n.Value <> 0 Then
                    n.Value = 0
   ProtectedCell:
               End If
           End If
       Next n
   errorHandler:
       If Err = 1005 Then
            Resume ProtectedCell
       End If
   Next i

End Sub

</source>