format number

sal21

Board Regular
Joined
Apr 1, 2002
Messages
224
in the cloumn C2:C2500 in text format, i have this value

282215,82
8525,73
68574,93
10652,78
2722,29
4075,71
21283,73
....

this number is imported fronm a text file, from this line

var_CAUS = Trim(Mid(riga, 65, 14))

my prob is to insert a "." and trnsform in

282.215,82
8.525,73
68.574,93
10.652,78
2.722,29
4.075,71
21.283,73

automaticly whe the macro import the data string.
 

Some videos you may like

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

bjwillingham

Active Member
Joined
Jun 17, 2003
Messages
287
Try

var_CAUS = val(Trim(Mid(riga, 65, 14)) )

That will put a value in your cells. If your cells are formatted at "#.##,##" you should see what you want.
 

jimboy

Well-known Member
Joined
Apr 11, 2002
Messages
2,314
This works for me;

Code:
Sub Macro3()
'
    With Range("C2:C500")
    
    .NumberFormat = "#,##0.00"
    .Replace What:=",", Replacement:="."
    End With
End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,113,811
Messages
5,544,455
Members
410,612
Latest member
MrACED
Top