Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Find the same text multiple times in a string seperated by commas | Excel Discussion (Misc queries) | |||
count no. of commas (,) in a string in a cell | Excel Worksheet Functions | |||
removing commas from numbers etc. | Excel Worksheet Functions | |||
Removing commas | Excel Worksheet Functions | |||
Removing commas | Excel Programming |