PDA

View Full Version : text to number



amrane
10-08-2014, 05:01 AM
Dear Forum,

I am not founding in vba code to change cells contain form text to number!!

how to do it!!

currently, its EXCEL with comma as decimal point

br, amrane

ranman256
10-08-2014, 05:17 AM
set the column where you want. Also, instead of VAL ,you can use CDBL




Sub Cvt2Num()

range("A2").select
While ActiveCell.Value <> ""
ActiveCell.Value = val(ActiveCell.Value)
ActiveCell.Offset(1, 0).Select 'next row
Wend
End Sub

Bob Phillips
10-08-2014, 05:33 AM
Sub ReplaceCommas()
Columns("A:A").Replace What:=",", _
Replacement:=".", _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
MatchCase:=False, _
SearchFormat:=False, _
ReplaceFormat:=False
End Sub

amrane
10-08-2014, 09:31 AM
Dear Mr ranman256, Mr xld
Thx a lot for your quick suport,

br amrane