Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 06-09-2014, 10:26 AM
kd12 kd12 is offline How do I create currency cells in a Word Table Windows 7 64bit How do I create currency cells in a Word Table Office 2013
Banned
 
Join Date: Jun 2014
Location: Massachusetts
Posts: 10
kd12 is on a distinguished road
Default

Create a macro. It takes a little bit of effort, but then it will be super super easy.

I can't take the credit for this macro, it comes from here: http://ask.brothersoft.com/how-do-i-...le-113359.html
  • From the Developer tab, click the Macros button.
  • From the Macros in drop-down list, select Normal.dotm (this will make this macro available in all of your documents not just this one.
  • Enter a name for the Macro
  • Click the Create button.
  • The editor window opens.
  • Paste the following into the editor:
Code:
Sub CurrencyTableFormat() 
     '
     ' CurrencyTableFormat Macro
     '
     '
    Dim tCell As Word.Cell 
    Dim tRange As Range 
    If Selection.Type = wdSelectionIP Or Not Selection.Information(wdWithInTable) Then 
        MsgBox "Select numerical values in tables cells before running this macro.", , "Error" 
        Exit Sub 
    End If 
    For Each tCell In Selection.Cells 
        Set tRange = tCell.Range 
        tRange.End = tRange.End - 1 
        With tRange 
            If IsNumeric(tRange) Then 
                .Text = FormatCurrency(Expression:=.Text) 
            End If 
            On Error Goto Skip 
Skip: 
        End With 
    Next tCell 
End Sub
  • Save and close
  • Highlight the two columns, and run the macro
NOTE: The editor will have the "Sub [TITLE], the [TITLE] Macro and the End Sub lines already filled in, so you really just need to copy from Dim to tCell. Or you can use the title I used and just copy the whole thing

Last edited by macropod; 06-13-2014 at 03:46 PM. Reason: Added code tags & formatting
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Weird: 2 cells with data in Word 2010 table will not print! Mendopaul Word 8 03-23-2014 02:18 PM
How do I create currency cells in a Word Table Word 2007 Table - Shift Cells INDYBUG Word Tables 1 09-29-2013 05:47 PM
How do I create currency cells in a Word Table Word VBA: add textboxs in table cells? tinfanide Word VBA 12 02-09-2012 12:05 AM
How do I create currency cells in a Word Table Set range for merged Word table cells? tinfanide Word VBA 1 02-06-2012 05:57 AM
Formatting Cells for Currency and Accounting Sparetyme Excel 1 07-11-2010 01:26 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:46 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft