VBA/Excel/Access/Word/Data Type/Type Mismatch — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
Admin (обсуждение | вклад) м (1 версия) |
(нет различий)
|
Текущая версия на 12:48, 26 мая 2010
Catch the type mismatch error
Sub ResetValues()
On Error GoTo errorHandler
For Each n In ActiveSheet.UsedRange
If n.Value <> 0 Then
n.Value = 1
End If
TypeMismatch:
Next n
errorHandler:
If Err = 13 Then "Type Mismatch
Resume TypeMismatch
End If
End Sub