Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default replacing , with nothing ?

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,117
Default replacing , with nothing ?

i used the macro recorder & it worked that way.
xxxxxxxxxxxxx
Sub test()
'
' test Macro
' Macro recorded 10/30/2006 by Susan

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

End Sub
xxxxxxxxxxxxxxxxxxx
the code looks the same - don't know why yours isn't working.
susan


sverre wrote:
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


  #3   Report Post  
Posted to microsoft.public.excel.programming
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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Replacing ? ddate Excel Worksheet Functions 1 January 25th 07 01:31 AM
Replacing #N/A RFJ Excel Worksheet Functions 1 December 11th 06 04:39 PM
Replacing #N/A with a '0' (zero) neilcarden Excel Worksheet Functions 5 April 20th 05 02:49 PM
replacing #N/A with 0 Mark Excel Discussion (Misc queries) 3 April 7th 05 10:02 PM
Help Replacing all ( * ) with ( - ) Jeam Excel Discussion (Misc queries) 2 December 3rd 04 03:36 PM


All times are GMT +1. The time now is 12:07 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"