![]() |
|
#1
|
|||
|
|||
|
Hi,
I have a userform which requires to the user to enter the number of kilometers travelled. On the word document the number of kms shows but also the cost (i.e. $0.85/km) I've managed to do the code for this and it's working great. The only issue is that the amount that goes to the bookmarked place for the cost is showiong as 1 decimal place (It's $....). Can someone please help me with the code I need to format the cost amount correctly? Below is the code - it shows the number of Kms going to the bookmarked location for that in the document and the cost (once calculated) going to the bookmarked place for it. Dim KMsTravelled As Range Set NumberKMs = ActiveDocument.Bookmarks("NumberKms").Range NumberKMs.Text = Me.KMsTravelled.Value Dim KMsCost As Range Set KMsCost = ActiveDocument.Bookmarks("KMsCost").Range KMsCost.Text = Me.KMsTravelled.Value * 0.85 Thanks for your help |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
With macro/userform to replace bookmark only works with number
|
TheBigBoss | Word VBA | 2 | 03-27-2022 10:26 PM |
Can I use a variable to display the page number of a bookmark ?
|
delboy | Word | 3 | 12-29-2020 01:16 PM |
I don't understand new formatting marks word has spontaneously added to my document
|
RichardJ | Word | 5 | 07-30-2020 11:04 AM |
| how to get Word to automatically re-number the headings when a new on is added | lauped | Word | 3 | 07-13-2019 10:32 AM |
Add external hyperlink to a calculated number
|
Harleygal17 | Excel | 4 | 04-06-2017 11:38 PM |