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 / Word / Programming / January 2006

Tip: Looking for answers? Try searching our database.

Euro

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
MarcoPolo - 27 Jan 2006 08:33 GMT
I need to select the amount in Euro in a context like that:

Deliveries: Euro 500,00 till 500 km
Taxes: Euro 450,00
Total amount: Euro 1.450,00

i need to store into variables only the numbers in euro (500,00 450,00
1.450,00)
How can i store them, as the selection.move unit:=dWord is not working cause
comma is different in europe?
Helmut Weber - 27 Jan 2006 09:41 GMT
Hi,

have a look at this one, just to get you going.
Whether it is working or not,
depends on how consistent your text is.
I am assuming, e.g., that Euro is followed
by _one_ space. If you want to cover all
possible variations including typos,
this could become pretty complicated.

Sub Test()
Dim sTmp As String
Dim rDcm As Range
Set rDcm = ActiveDocument.Range
With rDcm.Find
  .Text = "Euro "
  .MatchCase = True
  While .Execute
     rDcm.Collapse direction:=wdCollapseEnd
     While IsNumeric(rDcm.Next) Or _
        rDcm.Next = "." Or _
        rDcm.Next = ","
        rDcm.End = rDcm.End + 1
        rDcm.Select ' for testing preferably in single step mode
     Wend
     sTmp = rDcm.Text
     MsgBox CSng(sTmp)
     '  result probably depending on local settings
     rDcm.Collapse direction:=wdCollapseEnd
     rDcm.End = ActiveDocument.Range.End
  Wend
End With
End Sub

sTmp is a string, though.

If you need the value in a variable of type single,
we could continue with a function for converting
a string into a single, which works regardless
of regional settings.
--
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
"red.sys" & chr(64) & "t-online.de"
Word 2002, Windows 2000
MarcoPolo - 27 Jan 2006 10:07 GMT
Danke schön !!!!!!!!!!!!!!!!!

> Hi,
>
[quoted text clipped - 41 lines]
> "red.sys" & chr(64) & "t-online.de"
> Word 2002, Windows 2000

Rate this thread:






 
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.