jmpmolegraaf
New Member
- Joined
- Jul 10, 2013
- Messages
- 35
In my excel file I have Numbers that are stored as Text and by multiplying the value by 1 it is normally solved (i.e. the cell value becomes a number).
If I do the following simple test it works:
Range("A1") = Range("A1") * 1
Now I have a big file and I want to use an Array to do so but it doesn't work. This is my code:
Dim Arr As Variant
Arr = Range(Cells(2, 6), Cells(lastrowraw, 10)).Value
Dim R As Integer
Dim C As Integer
For R = LBound(Arr, 1) To UBound(Arr, 1)
For C = LBound(Arr, 2) To UBound(Arr, 2)
Arr(R, C) = Arr(R, C) * 1
Next C
Next R
The Array is correctly assigned and the value are correct if I follow the macro's progress. FYI, lastrowraw is already declared before and is also correct.
However, in my cells I see no conversion to numbers while the simple test works.
What is wrong here?
If I do the following simple test it works:
Range("A1") = Range("A1") * 1
Now I have a big file and I want to use an Array to do so but it doesn't work. This is my code:
Dim Arr As Variant
Arr = Range(Cells(2, 6), Cells(lastrowraw, 10)).Value
Dim R As Integer
Dim C As Integer
For R = LBound(Arr, 1) To UBound(Arr, 1)
For C = LBound(Arr, 2) To UBound(Arr, 2)
Arr(R, C) = Arr(R, C) * 1
Next C
Next R
The Array is correctly assigned and the value are correct if I follow the macro's progress. FYI, lastrowraw is already declared before and is also correct.
However, in my cells I see no conversion to numbers while the simple test works.
What is wrong here?