If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Currency sign and formulas
Hello all,
I use a table in a document to create an invoice. When I fill in ammount (A2) and price (B2) the formula gives te total (C2, with fielcodes for notation/format). But I want the currency sign automaticaly placed before the price (B2) I give in. How can I change the format of a cell (with no formula in it), so when I type in for example 12, the value of the cell is $ 12,00. Any suggestions? Thanks in advance. |
#2
|
|||
|
|||
Currency sign and formulas
Probably the simplest plan would be to make this invoice into a form and use
form fields for the variable data - you can format the appropriate fields as numbers with currency masks. The calculations you can do outside the form fields using an = field with a currency mask. Make sure that you set the last form field's properties to calculate on exit so that the calculation will be updated. -- Graham Mayor - Word MVP Web site www.gmayor.com Word MVP web site www.mvps.org/word Marco wrote: Hello all, I use a table in a document to create an invoice. When I fill in ammount (A2) and price (B2) the formula gives te total (C2, with fielcodes for notation/format). But I want the currency sign automaticaly placed before the price (B2) I give in. How can I change the format of a cell (with no formula in it), so when I type in for example 12, the value of the cell is $ 12,00. Any suggestions? Thanks in advance. |
#3
|
|||
|
|||
Currency sign and formulas
Hi Graham,
First of all, thanks for your reply. If have two small questions: * Can you tell me how to format the fields as you mentioned? How do I make from a cell a form field? * How can I set the last form field's properties to calculate on exit? Thanks in advance, Marco. |
#4
|
|||
|
|||
Currency sign and formulas
See:
Please Fill Out This Form Part 1: Create professional looking forms in Word http://www.computorcompanion.com/LPMArticle.asp?ID=22 Part 2: Adding Automation to your Word forms. http://www.computorcompanion.com/LPMArticle.asp?ID=46 Part 3: Learn more VBA (macros) to automate your forms. http://www.computorcompanion.com/LPMArticle.asp?ID=119 Part 4: Use custom dialog boxes in your Word forms http://www.computorcompanion.com/LPMArticle.asp?ID=127 Part 5: Connect your AutoForm to a database to save input time and keep better records! http://www.computorcompanion.com/LPMArticle.asp?ID=136 -- Please post any further questions or followup to the newsgroups for the benefit of others who may be interested. Unsolicited questions forwarded directly to me will only be answered on a paid consulting basis. Hope this helps Doug Robbins - Word MVP "Marco" wrote in message ... Hi Graham, First of all, thanks for your reply. If have two small questions: * Can you tell me how to format the fields as you mentioned? How do I make from a cell a form field? * How can I set the last form field's properties to calculate on exit? Thanks in advance, Marco. |
#5
|
|||
|
|||
Currency sign and formulas
Hi Marco,
You need to add a currency picture switch to your calculation field, like: \# $,0.00 To do this, select the field and press Shift-F9, then add the switch to the end of the field and press F9 again to update the result. Cheers "Marco" wrote in message ... Hi Graham, First of all, thanks for your reply. If have two small questions: * Can you tell me how to format the fields as you mentioned? How do I make from a cell a form field? * How can I set the last form field's properties to calculate on exit? Thanks in advance, Marco. --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.676 / Virus Database: 438 - Release Date: 3/05/2004 |
#6
|
|||
|
|||
Currency sign and formulas
Marco,
Here is a scad of information on creating Word forms. See the linked articles by Dian Chapman. http://word.mvps.org/faqs/tblsfldsfms/LinesInForms.htm Basically you just need to display the forms tool bar, with the toolbar insert a form field in cell A2 and B2. Double click each formfield and apply the currency masks and check calculate on exit. -----Original Message----- Hi Graham, First of all, thanks for your reply. If have two small questions: * Can you tell me how to format the fields as you mentioned? How do I make from a cell a form field? * How can I set the last form field's properties to calculate on exit? Thanks in advance, Marco. . |
#7
|
|||
|
|||
Currency sign and formulas
First of all thanks all for the reply.
I'm almost there... I created the form with the pre-defined fields. I also use the option calculate on exit. But before I enter my information in the table, a macro is entering information in the top of the document. But when I secure the form already in the .DOT file the macro gives an error because of the protected form. Is there an option to add a vba line after everything is filled in, to protect the form? So my last lines a Unload frmInvoiceDataEntry ActiveDocument.Save End Sub But before the End Sub I would like to protect the form so the user can only fill in those fields I defined in the form. Thanks again everybody! Marco. |
#8
|
|||
|
|||
Currency sign and formulas
Marco,
Try before the ActiveDocument.Save: On Error GoTo Ignore ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True MsgBox "The form is now protected." Igno Err.Clear You might need to put a ActiveDocument.Unprotect line in somewhere in your code. HTH -----Original Message----- First of all thanks all for the reply. I'm almost there... I created the form with the pre- defined fields. I also use the option calculate on exit. But before I enter my information in the table, a macro is entering information in the top of the document. But when I secure the form already in the .DOT file the macro gives an error because of the protected form. Is there an option to add a vba line after everything is filled in, to protect the form? So my last lines a Unload frmInvoiceDataEntry ActiveDocument.Save End Sub But before the End Sub I would like to protect the form so the user can only fill in those fields I defined in the form. Thanks again everybody! Marco. . |
#9
|
|||
|
|||
Currency sign and formulas
Not having see the rest of your macro, can I suggest that you run all the
autonew macro code on an unlocked form template to insert whatever it was you were inserting at the top of the document then add the line ActiveDocument.Protect Type:=wdAllowOnlyFormFields To lock the form and provide access to only the fields. The above has the effect of clicking the padlock icon on the forms toolbar. Given that you have thrown in this extra requirement into the pot, I might have been tempted to suggest that you employ a userform to gather all your data run your bit of code and enter the data and calculations in the required parts of the document. This is a bit more elegant than an on-line form. There is loads of information about userforms on the MVPS web site - see link in sig block. -- Graham Mayor - Word MVP Web site www.gmayor.com Word MVP web site www.mvps.org/word Marco wrote: First of all thanks all for the reply. I'm almost there... I created the form with the pre-defined fields. I also use the option calculate on exit. But before I enter my information in the table, a macro is entering information in the top of the document. But when I secure the form already in the .DOT file the macro gives an error because of the protected form. Is there an option to add a vba line after everything is filled in, to protect the form? So my last lines a Unload frmInvoiceDataEntry ActiveDocument.Save End Sub But before the End Sub I would like to protect the form so the user can only fill in those fields I defined in the form. Thanks again everybody! Marco. |
#10
|
|||
|
|||
Currency sign and formulas
Thank you very much, all of you!
With your help I solved my problem. Thanks again! Marco. |
Thread Tools | |
Display Modes | |
|
|