MS Word >> DOLLAR SIGN TO A COLUMN

by Q2Fyb2xhbg » Thu, 29 Sep 2005 06:04:01 GMT

I made a table in Word. Is there a way to make a column that will
automatically add the dollar sign ($) when I type in it???
--
Carolan

MS Word >> DOLLAR SIGN TO A COLUMN

by macropod » Thu, 29 Sep 2005 06:37:41 GMT


Hi Carolan,

Word tables don't support automatic number formatting - you either have to
add the '$' manually or have it generated as part of a formfield or formula
field (neither of which you'd want to use for straight data-entry.

Cheers

MS Word >> DOLLAR SIGN TO A COLUMN

by Helmut Weber » Thu, 29 Sep 2005 19:21:09 GMT

Hi Carolan,

a bit of programming just for fun,
nothing serious really,
but if you like it, you might want to learn more about VBA.

Example for column 1:

Sub NextCell()
Dim n As String
If Selection.Information(wdEndOfRangeColumnNumber) = 1 Then
n = Selection.Cells(1).Range.Text
n = Left(n, Len(n) - 2)
If IsNumeric(Left(n, Len(n))) And _
Right(n, 2) <> " $" Then
n = n & " $"
Selection.Cells(1).Range.Text = n
End If
End If
WordBasic.NextCell
End Sub

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"

MS Word >> DOLLAR SIGN TO A COLUMN

by Q2Fyb2xhbg » Fri, 30 Sep 2005 02:02:05 GMT

May seem silly on my part - but how do I make this work work??
--
Carolan

MS Word >> DOLLAR SIGN TO A COLUMN

by Helmut Weber » Fri, 30 Sep 2005 04:47:49 GMT

Hi Carolan,


That's the real difficult part for a beginner,
hardly possible to take you by the hand with so many possibilities.

Just one of several ways:

Open the VBA-editor [alt F11],
open the project explorer [ctrl r],
which may be open anyway,
click on "normal" usually on top and bold
in the "project - project" window,
in the menu, click on "insert, module".

Paste this:
'---
Sub NextCell()
' revised !
Dim n As String
If Selection.Information(wdEndOfRangeColumnNumber) = 1 Then
n = Selection.Cells(1).Range.Text
n = Left(n, Len(n) - 2)
If IsNumeric(n) And _
Right(n, 2) <> " $" Then
n = n & " $"
Selection.Cells(1).Range.Text = n
End If
End If
WordBasic.NextCell
End Sub
'---

Save: [ctrl s]
Close: [alt F4]

If You press [tab] in a cell,
the built in command "NextCell" is executed.
However, since you have your own command "NextCell" now,
your "NextCell" is executed.
It overrides the built in command.

But, as with the new "NextCell"
the selection wouldn't move anymore,
it is necessary to have a substitute,
which is WordBasic.NextCell, a usefule relict from former times.

The macro grabs the text in the cell,
cuts off the cell mark, which is two characters long,
checks whether what's left is a number,
checks whether the rightmost 2 characters are not " $" anyway,
and if so, set the cells text to the number & " $".


HTH

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"

MS Word >> DOLLAR SIGN TO A COLUMN

by Q2Fyb2xhbg » Sat, 01 Oct 2005 01:17:04 GMT

Thanks so very much, Helmut - I even managed to change to column it effects.
It's a wonderful tool.
--
Carolan
Alberta, Canada

Similar Threads

1. put minus sign before dollar sign in merged document - Microsoft Office

2. Dollar sign

Can anyone help please.  I have set up my XP and Office Prof and when typing 
in word, my dollar sign ($ - this is what it should look like) has 2 lines 
thru it as in the American Dollar and not one as in the Australian Dollar.  
Please help as it is doing it in all my documents.

3. how do i change the dollar sign to the pound permanently - Word Document management

4. Dollar sign Alignment

How can I get my dollar signs to align as I can in Excel?  

5. bullets becoming dollar signs on Word documents - Word Document management

6. Bullet points in Word 2007 become dollar signs in previous version

I'm using a trial version of Word 2007 to wrtie my resume which has bullet 
points on it.  I'm getting feedback that the bullet points are showing as 
dollar signs for the receivers of my resume who use Word 2003 or an earlier 
version.  I don't know what to do.

7. get rid of formating automatic dollar signs for money amounts - Word Document management

8. Dollar Signs and Zero Values

I am attempting to merge a Word document and an Excel 
spreadsheet.  When I merge the 2 together I lose my dollar 
signs and my decimals - though this site I found how to 
put the switch in the field code to get the dollar sign 
and that decimal but but now when the value is empty in 
the spreadsheet I get a 0 in my mail merge document - is 
there more that I need to add to the switch I put in - 
Currently my merge field reads like this

{Mergefield Amout \#"$#.00;($#.00)