Export number formatting

Sweedler

Board Regular
Joined
Nov 13, 2020
Messages
114
Office Version
  1. 2016
Platform
  1. Windows
  2. MacOS
Hello

I have an export where a column of "numbers" shows up like this: 105 895,9
According to excel the column is formatted as "accounting", but I can not use the number in any way .. ie Excel thinks it is text, or some kind of non-number.
I need a way to transform this into a usable number, ideally looking like this: 105895.9

The transformation needs to happen in VBA, as it needs to be a part of a string of things that a macro does.
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
You could try replacing the space and , as below:
VBA Code:
Sub test()
    Range("A:A").Replace " ", ""
    Range("A:A").Replace ",", "."
End Sub
 
Upvote 0
You could try replacing the space and , as below:
VBA Code:
Sub test()
    Range("A:A").Replace " ", ""
    Range("A:A").Replace ",", "."
End Sub
I tried that, it did not work. I had the comma replaced with a period in already and working. But the space replacement did not work. And it is still not seen as a true number.
 
Upvote 0
Try copying the space from one of the numbers and replace the space in the code with the one you copied. It could be that the space is not a true space. It could also be that the space is part of the formatting?
 
Upvote 1
Solution
Try copying the space from one of the numbers and replace the space in the code with the one you copied. It could be that the space is not a true space. It could also be that the space is part of the formatting?
That sorted it out. Hadn't thought of that one. Thank you so much.
 
Upvote 0

Forum statistics

Threads
1,215,089
Messages
6,123,058
Members
449,091
Latest member
ikke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top