How can I convert text numbers into a cell as a value?
=VALUE(A61)&VALUE(B61)
Example:
A61 = 348286
B61 = 5
vba formula in A62 something like "=VALUE(A61)&VALUE(B61)" to return 3,482,865
Sorry, this seems so simple but I'm stuck in a dull moment.
Add text strings together as value
-
- 5StarLounger
- Posts: 1185
- Joined: 24 Jan 2010, 12:02
- Location: Wales, UK.
Add text strings together as value
Nathan
There's no place like home.....
There's no place like home.....
-
- Administrator
- Posts: 78631
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Add text strings together as value
I think you want
Range("A62").Formula = "=VALUE(A61&B61)"
(You want to concatenate first, then convert back to a number.)
Range("A62").Formula = "=VALUE(A61&B61)"
(You want to concatenate first, then convert back to a number.)
Best wishes,
Hans
Hans
-
- 5StarLounger
- Posts: 1185
- Joined: 24 Jan 2010, 12:02
- Location: Wales, UK.
Re: Add text strings together as value
Yes, that works except it returns 3,482,865.00
How can I lose the .00
How can I lose the .00
Nathan
There's no place like home.....
There's no place like home.....
-
- Administrator
- Posts: 78631
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Add text strings together as value
By setting the number format for the cell, either interactively or through code:
Range("A62").NumberFormat = "#,##0"
Range("A62").NumberFormat = "#,##0"
Best wishes,
Hans
Hans
-
- 5StarLounger
- Posts: 1185
- Joined: 24 Jan 2010, 12:02
- Location: Wales, UK.