View Single Post
  #8   Report Post  
Posted to microsoft.public.word.tables
MIrving MIrving is offline
external usenet poster
 
Posts: 15
Default Cell content must appear as $#.##

Thank you. When I run it, I get an error 424 "object required":

Private Sub Price_Exit(ByVal Cancel As MSForms.ReturnBoolean)
txtBoxCurrency.Text = Format(txtBoxCurrency.Text, "$#,###,00")
End Sub

Where have a gone wrong? Thank you for your help.

"Doug Robbins - Word MVP" wrote:

In the Exit event of the textbox.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"MIrving" wrote in message
...
Thank you, that's great. A really basic question I'm sure, but where do I
put txtBoxCurrency.Text = Format(txtBoxCurrency.Text, "$#,###,00")?
Thanks
again.

"Doug Robbins - Word MVP" wrote:

Yes, that is certainly possible by the use of the Format() function

On exit from a textbox (TxtBoxCurrency)

txtBoxCurrency.Text = Format(txtBoxCurrency.Text, "$#,###,00")

Once you have the data formatted that way in the text box, as it is
actually
a String, that is how it will be inserted into the document.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"MIrving" wrote in message
...
Thank you for answering it. As an alternative, is it possible to
either:

1. In a VB userform, force a textbox entry (ie. whatever the user
inputs)
to always be displayed as $#.##, irrespective of how the number is
entered
into the textbox; or

2. On clicking of the commandbutton in a userform, force the insertion
of
the text from each textbox into the Word document bookmark to always be
displayed as $#.##.

Thank you for any suggestions.


"Doug Robbins - Word MVP" wrote:

It is not possible with a Word table. You can however insert an Excel
Spreadsheet, which, except when the user is actually working in the
spreadsheet, will be indistinguisable from a Word table. You can then
make
use of the cell formatting abilities of Excel.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"MIrving" wrote in message
...
In Word 97, is it possible to set up cells in a table so that the
value
in
a
cell automatically appears as $#.##, irrespective of how a user
enters
the
amount? Thanks.