Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 05-16-2022, 08:05 PM
dohertym dohertym is offline Formatting a calculated number - to be added to bookmark Windows 10 Formatting a calculated number - to be added to bookmark Office 2021
Novice
Formatting a calculated number - to be added to bookmark
 
Join Date: May 2022
Posts: 6
dohertym is on a distinguished road
Default Formatting a calculated number - to be added to bookmark

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
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Formatting a calculated number - to be added to bookmark With macro/userform to replace bookmark only works with number TheBigBoss Word VBA 2 03-27-2022 10:26 PM
Formatting a calculated number - to be added to bookmark Can I use a variable to display the page number of a bookmark ? delboy Word 3 12-29-2020 01:16 PM
Formatting a calculated number - to be added to bookmark 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
Formatting a calculated number - to be added to bookmark Add external hyperlink to a calculated number Harleygal17 Excel 4 04-06-2017 11:38 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:12 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft