Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / September 2006

Tip: Looking for answers? Try searching our database.

Replace with Macros

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
frpascal - 29 Sep 2006 09:47 GMT
Hi folks,

I need to replace the "," by a "." in many cells to fit another country
decimal separation. My regional parameters use normally ",".

When I do it into Excel with the replace function it is ok and produce the
macro script :

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

But when I run the macro it change nothing and keep the ","

Thanks for any help !
Pascal
Jim Cone - 29 Sep 2006 13:11 GMT
Does your data actually contain "," or just formatted to display them?
Signature

Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware

"frpascal"
wrote in message
Hi folks,
I need to replace the "," by a "." in many cells to fit another country
decimal separation. My regional parameters use normally ",".

When I do it into Excel with the replace function it is ok and produce the
macro script :

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

But when I run the macro it change nothing and keep the ","
Thanks for any help !
Pascal

frpascal - 29 Sep 2006 15:10 GMT
The data contains ",".
I found a "solution" :

Price = Worksheets("TRU").Cells(J, 6).Value
entier = Int(Price)
reste = (Price - entier) * 100
Dim chiffr As String
chiffr = Format(entier, 0) + "." + Format(reste, 0)
Worksheets("SEND").Cells(Ind, 10).NumberFormat = "@"
Worksheets("SEND").Cells(Ind, 10) = chiffr

It's not very nice but it works. I'll prefer a Replace function...

Thanks for your help
Pascal

> Does your data actually contain "," or just formatted to display them?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.