hi!
der inhalt eines textfeldes ist grundsätzlich ein string.
mit der funktion isnumeric kannst du prüfen ob es eine zahl ist.
mit clong kann der variablentyp eines numerischen strings in long
umgewandelt werden.
eine universale lösung ist die verwendung des datentyps variant.
mit vartype kann man den datentyp dann abfragen
sub testevariable
dim x as variant
dim xtyp as integer
x = text4
xtyp = vartype(x)
select case xtyp
case vblong
'dann mach folgendes
case vbstring
'dann mach folgendes
end select
end sub
mit if - then ist es auch möglich, aber ich halte das für einfacher, und mann kann es leicht auf weitere variablentypen erweiteren.
mehr information in der vb-hilfe zur vartype-funktion
mfg
wb
|