Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
JNW JNW is offline
external usenet poster
 
Posts: 480
Default Replacing dots with commas using macro

Sorry about that, I got the commas and dots switched around. The number
format you are looking to use is european style (well pretty much anywhere
other than the U.S. and canada use it). In order to have a number (0.00) be
formatted like this 0,00 and be used as a number in excel you've got to
change your global settings.

Add this into your code:
'You may want to put this in the workbook_open event of the workbook
'That way you don't have to think about it.
With Application
.DecimalSeparator = ","
.ThousandsSeparator = "."
.UseSystemSeparators = False
End With
'Now you can use the following.
'Don't worry about the dot because the globals are changed
Range("A1:A10").Select
Selection.NumberFormat = "0.00"

'You will also want to reset your globals.
'Possibly on a workbook_beforeclose event


"maxest" wrote:


No, it didnt help. I'll try to explain that situation better.

I'm using commas as decimal separator, but data that I work with, comes
from another application (web-based) that uses dots as separator. When I
paste data tables to a Excel chart all numbers are handeled as text. My
objective is to convert them to the numbers.

After using Replace function in macro it replaces dots with commas, but
numres are still text and can't be ussed in financial functions. It
helps when I manually edit cell (F2) and hit Enter after that, but i
cant edit all 500 cells manually.

When I use Replace function from Edit menu manually, it work perfectly
and I dont have problem with number that are in text format.

I have tried also to change format of cell in every way but it doesnt
work. Work only F and Enter.


--
maxest
------------------------------------------------------------------------
maxest's Profile: http://www.excelforum.com/member.php...o&userid=30143
View this thread: http://www.excelforum.com/showthread...hreadid=498282


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
Combobox changes the decimal commas to dots - How to prevent it? Erkka Excel Discussion (Misc queries) 2 February 23rd 07 08:20 AM
Change dots to commas!! Andreas Excel Discussion (Misc queries) 1 November 18th 06 12:55 AM
Replacing commas with carriage return Hardip Excel Worksheet Functions 4 September 1st 05 01:39 PM
Change Dots into Commas as Decimal Divider xenia Excel Discussion (Misc queries) 2 August 8th 05 09:48 AM
Replacing Tab with commas Dan T[_3_] Excel Programming 1 July 17th 04 10:09 PM


All times are GMT +1. The time now is 06:33 PM.

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"