LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Converting European number formats

Hi, all,

I work some with data from Europe and have trouble getting numbers into U.S.
format.

I found a promising looking macro on the web, written by David McRitchie:

http://www.mvps.org/dmcritchie/excel/numconv.htm
-----------------------------
Sub USNumbers()
'David McRitchie 2000-05-10 misc convert text numbers
' under wrong control settings to numbes
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Dim cell As Range
Dim origValue As String
Dim newValue As String
On Error Resume Next
For Each cell In Selection.Cells.SpecialCells(xlConstants, xlTextValues)
origValue = cell.Value
newValue = ""
For i = 1 To Len(origValue)
If Mid(origValue, i, 1) = "." Then
newValue = newValue & ","
ElseIf Mid(origValue, i, 1) = "," Then
newValue = newValue & "."
Else
newValue = newValue & Mid(origValue, i, 1)
End If
Next i
On Error Resume Next
cell.Value = CDbl(Trim(newValue))
On Error GoTo 0
Next cell
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub
-----------------------------

But when I try to run it in Excel 2010, I get an error about the For-Loop
not being set. Not sure how to proceed. Any help would be appreciated.

-S

 
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
Converting dates to different formats Nelson B. Excel Discussion (Misc queries) 5 September 2nd 09 03:03 PM
Excel 2003, European number format Loulou Excel Discussion (Misc queries) 2 August 21st 08 04:03 PM
Read both US and European Formats MFINE Excel Discussion (Misc queries) 0 August 17th 07 02:00 AM
European date formats lynniemilano Excel Worksheet Functions 1 September 13th 05 05:47 PM
Converting file formats Ryan Brown Excel Programming 2 December 18th 03 11:05 PM


All times are GMT +1. The time now is 10:05 AM.

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"