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, ",", "")
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, ",", "")
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"
<TheIrishThug.208wqm_1134925801.689@excelforum-nospam.com> wrote
in message
news:TheIrishThug.208wqm_1134925801.689@excelforum-nospam.com...
>
> 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
>
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" <TheIrishThug.208wqm_1134925801.689@excelforum-nospam.com>
wrote in message
news:TheIrishThug.208wqm_1134925801.689@excelforum-nospam.com...
>
> 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
>
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" <TheIrishThug.208wqm_1134925801.689@excelforum-nospam.com>
wrote in message
news:TheIrishThug.208wqm_1134925801.689@excelforum-nospam.com...
>
> 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
>
hmm, it works now. thanks for the help. and no, i'm running i have office 03
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks