Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default removing commas from a string


i need to make "1,458,685" into "1458685
i found Replace() on a website and assumed leaveing the last paramater
empty would work. it doesn't

this is what i was trying:
PrizePool = Replace(PrizePool, ",", "")


--
TheIrishThug
------------------------------------------------------------------------
TheIrishThug's Profile: http://www.excelforum.com/member.php...o&userid=29682
View this thread: http://www.excelforum.com/showthread...hreadid=494444

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default removing commas from a string

The following works:

Dim S As String
Dim R As String
S = "123,456"
R = Replace(S, ",", "")
Debug.Print R


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"TheIrishThug"
wrote
in message
...

i need to make "1,458,685" into "1458685
i found Replace() on a website and assumed leaveing the last
paramater
empty would work. it doesn't

this is what i was trying:
PrizePool = Replace(PrizePool, ",", "")


--
TheIrishThug
------------------------------------------------------------------------
TheIrishThug's Profile:
http://www.excelforum.com/member.php...o&userid=29682
View this thread:
http://www.excelforum.com/showthread...hreadid=494444



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default removing commas from a string

That should work. Where is PrizePool declared, and what is stored in it?

Also, you don't have Excel97 do you?

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"TheIrishThug"
wrote in message
...

i need to make "1,458,685" into "1458685
i found Replace() on a website and assumed leaveing the last paramater
empty would work. it doesn't

this is what i was trying:
PrizePool = Replace(PrizePool, ",", "")


--
TheIrishThug
------------------------------------------------------------------------
TheIrishThug's Profile:

http://www.excelforum.com/member.php...o&userid=29682
View this thread: http://www.excelforum.com/showthread...hreadid=494444



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default removing commas from a string

something like this should work

Option Explicit
Sub test()
Dim cell As Range
Dim rng As Range
Set rng = Range("PrizePool")

For Each cell In rng
cell.Value = Replace(cell.Value, ",", "")
Debug.Print cell.Value
Next

End Sub

--


Gary


"TheIrishThug"
wrote in message
...

i need to make "1,458,685" into "1458685
i found Replace() on a website and assumed leaveing the last paramater
empty would work. it doesn't

this is what i was trying:
PrizePool = Replace(PrizePool, ",", "")


--
TheIrishThug
------------------------------------------------------------------------
TheIrishThug's Profile:
http://www.excelforum.com/member.php...o&userid=29682
View this thread: http://www.excelforum.com/showthread...hreadid=494444



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default removing commas from a string


hmm, it works now. thanks for the help. and no, i'm running i have
office 03


--
TheIrishThug
------------------------------------------------------------------------
TheIrishThug's Profile: http://www.excelforum.com/member.php...o&userid=29682
View this thread: http://www.excelforum.com/showthread...hreadid=494444

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
Find the same text multiple times in a string seperated by commas clcnewtoaccess Excel Discussion (Misc queries) 1 March 31st 09 02:02 PM
count no. of commas (,) in a string in a cell hsg Excel Worksheet Functions 3 March 24th 09 06:51 PM
removing commas from numbers etc. Excel ??[_2_] Excel Worksheet Functions 2 August 10th 07 09:26 AM
Removing commas Ernie Sersen Excel Worksheet Functions 1 December 13th 04 05:15 PM
Removing commas rcmiv Excel Programming 4 October 18th 04 01:37 PM


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

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

About Us

"It's about Microsoft Excel"