いつもお世話になっております。
以下の式で乗算をしようとしておりますが、
元DTに空白セルがある為、エラーとなっております。
このような場合、どのような処理をさせたら良いのか教えて頂きたくよろしくお願い致します。
左辺:CurrentRow.Item(currentNumber)
右辺:CDbl(CurrentRow.Item(currentNumber)) * CDBL(CurrentRow.Item(“列タイトル”))
いつもお世話になっております。
以下の式で乗算をしようとしておりますが、
元DTに空白セルがある為、エラーとなっております。
このような場合、どのような処理をさせたら良いのか教えて頂きたくよろしくお願い致します。
左辺:CurrentRow.Item(currentNumber)
右辺:CDbl(CurrentRow.Item(currentNumber)) * CDBL(CurrentRow.Item(“列タイトル”))
First you can check if the numberis numeric or not…if not then can pass 0 or 1 as needed
CurrentRow.Item("ColumnName").ToString.IsNumeric
This gives true if the value is number else false…
So can use like this
If(CurrentRow.Item("ColumnName").ToString.IsNumeric,CDBL(CurrentRow.Item("ColumnName").ToString),0)
Cheers
Hello @miwa_yamamoto
Try If Condition
Not String.IsNullOrEmpty(CurrentRow("Column").ToString)
If there is data in cell, it will perform Then action. If there is Null value, it will perform Else action
こんにちは
右辺は以下を使いください。(空白他数値とみなされない場合は0としています)
If(Double.TryParse(CurrentRow.Item(currentNumber).ToString,New Double) AndAlso Double.TryParse(CurrentRow.Item("列タイトル").ToString,New Double),CDbl(CurrentRow.Item(currentNumber)) * CDBL(CurrentRow.Item("列タイトル")),0)
Yoichi様
いつも本当にありがとうございます。
お陰様で無事に計算出来るようになりました。
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.