Rozwiązaniem może być ręczne testowanie danych na ich poprawność i w razie niezgodności ponowny monit o wpisanie danych.
Przykładowe makro:
msg - to komunikat
tit - tytuł okienka
def - opcjonalnie wstawiana wartość domyślna
Function readNum(msg, tit, Optional def As String) _
As Double
Dim temp
temp = InputBox(msg, tit, def)
If (IsNull(temp) = True) Then
temp = read_numeric(msg, tit, def)
Else
If (IsNumeric(temp) = False) Then
temp = read_numeric(msg, tit, def)
End If
End If
read_numeric = temp
End Function
Funkcja będzie domagać się do skutku wpisania wartości poprawnej - numerycznej.
0 komentarze:
Prześlij komentarz