Formating a cell so that it contains only numbers

S

sugarmac

I have created a table on Word 2004 for Mac and I need to make a row of cells
that can contain only numbers. I don't need any formulas, just a number
containing two decimal places. Eg. If I type 10 into the cell, I want it to
automatically change it to 10.00. Does this make sense? In Excel you go to
"Format -> Cells... -> Number" and it gives you the option to place the
amount of decimal points. Is this even possible in Word? I can't seem to find
anything in the help files – it just tells me how to create formulas with
decimal places.
 
M

macropod

Hi sugarmac,

The only ways to get that functionality in Word are to:
a) set the table up with formfields for numeric data entry, and protect the document for forms, or
b) embed an Excel workbook in the document with the appropriate cell formatting.

Cheers
 
S

sugarmac

Thanks, I'll give b) a try!

macropod said:
Hi sugarmac,

The only ways to get that functionality in Word are to:
a) set the table up with formfields for numeric data entry, and protect the document for forms, or
b) embed an Excel workbook in the document with the appropriate cell formatting.

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

sugarmac said:
I have created a table on Word 2004 for Mac and I need to make a row of cells
that can contain only numbers. I don't need any formulas, just a number
containing two decimal places. Eg. If I type 10 into the cell, I want it to
automatically change it to 10.00. Does this make sense? In Excel you go to
"Format -> Cells... -> Number" and it gives you the option to place the
amount of decimal points. Is this even possible in Word? I can't seem to find
anything in the help files – it just tells me how to create formulas with
decimal places.
 
S

sugarmac

Hi macropod

What about numeric picture (\#) field switches, do those work without
formulas?

Thanks for any feedback!


macropod said:
Hi sugarmac,

The only ways to get that functionality in Word are to:
a) set the table up with formfields for numeric data entry, and protect the document for forms, or
b) embed an Excel workbook in the document with the appropriate cell formatting.

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

sugarmac said:
I have created a table on Word 2004 for Mac and I need to make a row of cells
that can contain only numbers. I don't need any formulas, just a number
containing two decimal places. Eg. If I type 10 into the cell, I want it to
automatically change it to 10.00. Does this make sense? In Excel you go to
"Format -> Cells... -> Number" and it gives you the option to place the
amount of decimal points. Is this even possible in Word? I can't seem to find
anything in the help files – it just tells me how to create formulas with
decimal places.
 
J

Jean-Guy Marcil

sugarmac said:
Hi macropod

What about numeric picture (\#) field switches, do those work without
formulas?

The key word here is "field". They only work with fields. It would a lot
more trouble to insert fields with the numerical values you want than just
type something like "10.00."
As macropod wrote, the only way fields will work automatically (I.e. by the
user just typing in the field without the field being replaced by what is
being typed) is to work with a protected form.
 
S

sugarmac

OK. Thanks.

Jean-Guy Marcil said:
The key word here is "field". They only work with fields. It would a lot
more trouble to insert fields with the numerical values you want than just
type something like "10.00."
As macropod wrote, the only way fields will work automatically (I.e. by the
user just typing in the field without the field being replaced by what is
being typed) is to work with a protected form.
 
G

Graham Mayor

I guess you could use a macro attached to a keyboard shortcut eg

Sub InsertNumberAsField()
Dim sNum As String
sNum = InputBox("Enter number")
If sNum = "" Then Exit Sub
sNum = sNum & " \# ,0.00"
With Selection.Fields
.Add Range:=Selection.Range, Type:=wdFieldEmpty, _
Text:="= " & sNum, _
PreserveFormatting:=False
.Update
End With
ActiveWindow.View.ShowFieldCodes = False
End Sub

but it is simpler just to type the number correctly.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

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