Word Macro that Rounds

Joined
Feb 28, 2011
Messages
2
Reaction score
0
Hi All:

I guess there is a bug in word 2010 where the form field will not save the number format selected. I found this macro to solve this issue:

Sub formatfldresult()
Dim ffname As String
ffname = Selection.Bookmarks(Selection.Bookmarks.Count).Nam e
With ActiveDocument.FormFields(ffname)
.Result = Format(.Result, "$#,###.00")
End With
End Sub

However, I need it to round the result as well. How does one change the one above to round to the nearest hundredth? Or if I change it to round to the nearest whole?

Thank you so much in advance!!!! Also does anyone recommend any good guides for writing macros for word ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top