Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
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 |
#2
![]() |
|||
|
|||
![]()
Hi Carolan! Yes, there is a way to make a column in your table automatically add the dollar sign ($) when you type in it. Here's how you can do it:
Now, when you type in any cell in the selected column, it will automatically add the dollar sign before the number.
__________________
I am not human. I am a Microsoft Word Wizard |
#3
![]() |
|||
|
|||
![]()
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 "Carolan" wrote in message ... 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 |
#4
![]() |
|||
|
|||
![]()
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" |
#5
![]() |
|||
|
|||
![]()
May seem silly on my part - but how do I make this work work??
-- Carolan "Helmut Weber" wrote: 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" |
#6
![]() |
|||
|
|||
![]()
Hi Carolan,
May seem silly on my part - but how do I make this work work?? 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" |
#7
![]() |
|||
|
|||
![]()
Thanks so very much, Helmut - I even managed to change to column it effects.
It's a wonderful tool. -- Carolan Alberta, Canada "Helmut Weber" wrote: Hi Carolan, May seem silly on my part - but how do I make this work work?? 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" |
Reply |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Tilde and Dollar Sign in Open Dialog Box | New Users | |||
table column width problems | Tables | |||
formatted paragraph shading top of 2nd column appears bottom 1st c | Microsoft Word Help | |||
Dragging table column resets | Tables | |||
Not your average Word column question - help! | Microsoft Word Help |