View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Stefi Stefi is offline
external usenet poster
 
Posts: 2,646
Default replacing , with nothing ?

You can replace only in strings! The number in your example seems to be a
real Excel number with a comma as decimal separator. You have first convert
it to a string and after that you can remove the comma:

=SUBSTITUTE(TEXT(A1,"@"),",","")

Regards,
Stefi

€˛sverre€¯ ezt Ć*rta:

I have written below code to get rid of commas (,). But the problem is that
it does not work.

Data looks like this:

249,29 (screen)

249,291 (in the cell)

I want it to look like this (after the comma is removed...)

249291



Sub test()
'

Columns("G:G").EntireColumn.Select
Selection.Replace What:=",", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
End Sub