Writing the result of arithmetic calculation in a cell
<Dim a, b, h, k, l As Double
Means:
Dim a as Variant, b as Variant, etc, l As Double
So Ron's right
Just declare all your variables explicitly (Dim A as Double, b as double, etc) and I think you're OK
--
Kind regards,
Niek Otten
Microsoft MVP - Excel
"Ron Rosenfeld" wrote in message ...
| On Sun, 29 Oct 2006 08:53:02 -0800, Merike
| wrote:
|
| In my macro a=1 and h=1
| And when I put
| Cells(i + 1, "D") = a+h
| then it writes 11 in the cell?
|
| But it should write 2. I'm using 2000 version.
|
| You don't provide enough info, but probably either a and h are DIM'd as
| strings, or you don't really have a=1 but rather a = some formula which is
| returning a "1" (and not a 1 )
|
|
| --ron
|