Reply
 
Thread Tools Display Modes
  #1   Report Post  
n_deneane93
 
Posts: n/a
Default How to make numbers look like currency in Word using a style?

I want to be able to enter numbers in to a column of a table and have it
automatically change to look like a currency value (2500 becomes $2,500.00)
-- like it does in Excel. Is this possible in Word with a style or a macro?
  #2   Report Post  
Suzanne S. Barnhill
 
Posts: n/a
Default How to make numbers look like currency in Word using a style?

There's no way to do this in Word unless (a) you insert an Excel sheet or
(b) the number is a field of some sort. In the latter case, you can use a
numeric picture switch to format it.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

"n_deneane93" wrote in message
...
I want to be able to enter numbers in to a column of a table and have it
automatically change to look like a currency value (2500 becomes

$2,500.00)
-- like it does in Excel. Is this possible in Word with a style or a

macro?

  #3   Report Post  
Doug Robbins - Word MVP
 
Posts: n/a
Default How to make numbers look like currency in Word using a style?

Starting with the second row, the following macro will convert all numbers
in the second column of the first table in the document.

Dim i As Long, mynum As Range
With ActiveDocument.Tables(1)
For i = 2 To .Rows.Count
Set mynum = .Cell(i, 2).Range
mynum.End = mynum.End - 1
.Cell(i, 2).Range = Format(mynum, "$#,##0.00")
Next i
End With

To have it operate on the first row, change i = 2 to i = 1; for a different
column change Cell(i, 2) to Cell(i, n) where n is the number of the column
and for a different table, change Tables(1) to Tables(#) where # is the
number of the table in 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

"n_deneane93" wrote in message
...
I want to be able to enter numbers in to a column of a table and have it
automatically change to look like a currency value (2500 becomes
$2,500.00)
-- like it does in Excel. Is this possible in Word with a style or a
macro?



  #4   Report Post  
n_deneane93
 
Posts: n/a
Default How to make numbers look like currency in Word using a style?

Thanks! I think I understand and I might be able to do that. I knew it
would not be as easy as Excel and figured some sort of macro would have to do
the trick. I'll work on it a bit and see what happens! Thanks for the tip.

"Suzanne S. Barnhill" wrote:

There's no way to do this in Word unless (a) you insert an Excel sheet or
(b) the number is a field of some sort. In the latter case, you can use a
numeric picture switch to format it.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

"n_deneane93" wrote in message
...
I want to be able to enter numbers in to a column of a table and have it
automatically change to look like a currency value (2500 becomes

$2,500.00)
-- like it does in Excel. Is this possible in Word with a style or a

macro?


  #5   Report Post  
n_deneane93
 
Posts: n/a
Default How to make numbers look like currency in Word using a style?

Thanks! I don't get it, but I am sure it works. My knowledge of macros is
nil. I guessed it would take a macro of some sort to make it work, but this
appears to be way out of my league. Thanks for taking the time to post.
You've answered my question.

"Doug Robbins - Word MVP" wrote:

Starting with the second row, the following macro will convert all numbers
in the second column of the first table in the document.

Dim i As Long, mynum As Range
With ActiveDocument.Tables(1)
For i = 2 To .Rows.Count
Set mynum = .Cell(i, 2).Range
mynum.End = mynum.End - 1
.Cell(i, 2).Range = Format(mynum, "$#,##0.00")
Next i
End With

To have it operate on the first row, change i = 2 to i = 1; for a different
column change Cell(i, 2) to Cell(i, n) where n is the number of the column
and for a different table, change Tables(1) to Tables(#) where # is the
number of the table in 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

"n_deneane93" wrote in message
...
I want to be able to enter numbers in to a column of a table and have it
automatically change to look like a currency value (2500 becomes
$2,500.00)
-- like it does in Excel. Is this possible in Word with a style or a
macro?






  #6   Report Post  
Greg
 
Posts: n/a
Default How to make numbers look like currency in Word using a style?

Is this possible in Word with a style or a macro?

Actually it is possible with a macro:

Sub ConvertToCurrencyAndAdvance()
Dim i As Long
Dim j As Long
Dim oNum As Range
If Not Selection.Information(wdWithInTable) Then Exit Sub
i = Selection.Information(wdStartOfRangeRowNumber)
j = Selection.Information(wdStartOfRangeColumnNumber)
With Selection.Tables(1)
Set oNum = .Cell(i, j).Range
oNum.End = oNum.End - 1
If IsNumeric(oNum) Then
.Cell(i, j).Range = Format(oNum, "$#,##0.00")
If i .Rows.Count Then
.Cell(i + 1, j).Select
ElseIf j .Columns.Count Then
.Cell(2, j + 1).Select
Else
.Cell(2, 1).Select
End If
Selection.Collapse Direction:=wdCollapseStart
Else
Beep
oNum.Select
End If
End With
End Sub

You will need to assign to an easy keyboard shortcut. Maybe ALT+Enter
or something similar. The macro will current valid numeric entries in
the cell and move down 1 cell. When it reaches the end of the cell it
will advance to the second row of the next column (or first column if
already in last column). You could easily adapt the code to advance
across vice down or to start in the first vice second row.

HTH

  #7   Report Post  
Greg Maxey
 
Posts: n/a
Default How to make numbers look like currency in Word using a style?

I posted a web page on this method this evening.

http://gregmaxey.mvps.org/Currency_Format.htm

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

Doug Robbins - Word MVP wrote:
Starting with the second row, the following macro will convert all
numbers in the second column of the first table in the document.

Dim i As Long, mynum As Range
With ActiveDocument.Tables(1)
For i = 2 To .Rows.Count
Set mynum = .Cell(i, 2).Range
mynum.End = mynum.End - 1
.Cell(i, 2).Range = Format(mynum, "$#,##0.00")
Next i
End With

To have it operate on the first row, change i = 2 to i = 1; for a
different column change Cell(i, 2) to Cell(i, n) where n is the
number of the column and for a different table, change Tables(1) to
Tables(#) where # is the number of the table in the document.


"n_deneane93" wrote in message
...
I want to be able to enter numbers in to a column of a table and
have it automatically change to look like a currency value (2500
becomes $2,500.00)
-- like it does in Excel. Is this possible in Word with a style or a
macro?



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
chapter & page number @ bottom of page Grace Page Layout 9 October 12th 05 06:38 AM
Specific text placement Nospam New Users 9 October 11th 05 01:23 AM
How do I create a Word form like corel WP merge documents? dlee_at_mmsgov Microsoft Word Help 2 October 8th 05 06:29 AM
Boiletplates from Word Perfect linda Microsoft Word Help 1 January 28th 05 05:37 PM
How to change merge forms from Word Perfect to Microsoft Word dollfindance Microsoft Word Help 2 December 30th 04 03:35 PM


All times are GMT +1. The time now is 05:45 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"