How to know datatype of a cell
<p>I have been stuck here for a while and getting run time error 13 - Type Mismatch.</p>

<pre><code>Dim Qty, ItemCost, Tot
Qty = wi.Range("C" &amp; i).Value2              'Qty
ItemCost = wi.Range("K" &amp; i).Value2         'Item Cost
Tot = CInt(Qty) * CInt(ItemCost)
</code></pre>

<p>when I tried IsNumeric on C and K column cells they are true but still I am getting that error.</p>

<p>I also tried:</p>

<pre><code>Tot = Qty * ItemCost
</code></pre>

<p>And</p>

<pre><code>Tot = CDbl(Qty) * CDbl(ItemCost)
</code></pre>

<p>And</p>

<pre><code>Tot = Qty * CInt(ItemCost)
</code></pre>

<p>And other different combinations of converting it to integer or double data type.</p>

<p>I also manually formatted the col C and K as Numbers.</p>

<p>Still the error persist. I don't know what to do where I am wrong ? </p>