IsNumeric – to mi hlava nebere

0
0

Dobrý den,
v proceduře VBA testuji podmínku, jestli je v jisté buňce číselná hodnota. Buňka je prázdná, jak je vidět níž, ale IsNumeric vrací TRUE.
Kde je chyba?

Watch : : IsNumeric(Worksheets("Etalony").Cells(jj + 1, J + 5).Value) : True : Boolean : ThisWorkbook.Workbook_SheetChange
Watch : : Worksheets("Etalony").Cells(jj + 1, J + 5).Value : Empty : Variant/Empty : ThisWorkbook.Workbook_SheetChange

Dalibor.

Marked as spam
Odeslal Anonymous
Otázka položena 29.10.2019 11:38
25 views
0
Private answer

Asi se musí použít funkce sešitu WoksheetFunction.IsNumber(Worksheets("Etalony").Cells(jj + 1, J + 5).Value). S tou to funguje. Prádno buňku bere IsNumeric asi jako implicitní nulu. Ale v helpu jsemse to nedočetl.
Dalibor.

Marked as spam
Odeslal Anonymous
Odpověděl 29.10.2019 13:53
0
Private answer

A toto jsem pak vyguglil:
Difference between IsNumber and IsNumeric in VBA
IsNumber checks if a value is stored as a number. On the other side, IsNumeric checks if a value can be converted into a number. This is the main difference between the two functions.
For example, if you pass a blank cell as a parameter, IsNumber will return FALSE, while IsNumeric will return TRUE. Also, if you pass a cell containing number stored as a text IsNumber will return FALSE and IsNumeric TRUE.
You need to pay attention to these limitations of both functions and decide in which cases is better to use IsNumeric and when IsNumber.

Marked as spam
Odeslal Anonymous
Odpověděl 29.10.2019 13:57
0
Private answer

Je to tak.

Marked as spam
Odeslal xlnc
Odpověděl 29.10.2019 22:32

Odešlete svou odpověď

Attach YouTube/Vimeo clip putting the URL in brackets: [https://youtu.be/Zkdf3kaso]