Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 03-15-2022, 07:25 AM
Ulodesk Ulodesk is offline Macro for setting decimal tabs in tables Windows 10 Macro for setting decimal tabs in tables Office 2016
Word 2013 Expert Cert
Macro for setting decimal tabs in tables
 
Join Date: Sep 2009
Location: Virginia
Posts: 872
Ulodesk is on a distinguished road
Default Macro for setting decimal tabs in tables


At work we sometimes get pricing tables -- sometimes quite extensive -- in Word that have originated in Excel, in which the numbers are right aligned but by means of a number of preceding spaces. I think these spaces must be an artifact of some conversion process (I can’t imagine anyone creating a giant table in Excel and trying to align the numbers to the right this way), but I'm unable to recreate it. As shown in the attachment, the spaces in Word then push the longer numbers over onto the next line.

My purpose is to try to create a macro that can be applied to the Word table to replace the spaces with a decimal tab that will align the numbers properly. I don't know how to code, but I can record a basic macro. (Thank you for suppressing your mirth.).

Left-aligning the column content I can do, and in the find&replace function with wildcards, ( ){2,} will select the spaces, but I can't find the VBA for a decimal tab to use in the replace field.

Once the tab is "installed", perhaps it can be specified as a distance from the right cell border or inside margin, since table content, layout, and column widths vary. This could then be easily edited if needed.

Help is much appreciated, as always.

(If you know what typically used format in Excel creates these spaces in Word, I'd love to know.)
Attached Files
File Type: docx Numbers.docx (14.5 KB, 9 views)
Reply With Quote
 

Tags
decimal tab, table



Similar Threads
Thread Thread Starter Forum Replies Last Post
Decimal tabs with space as thousands separator harry Word 1 12-22-2023 02:59 PM
Macro for setting decimal tabs in tables Macro to delete tabs in Word Shelley Lou Word VBA 16 12-21-2020 06:34 AM
Macro for setting decimal tabs in tables I need a macro to format images and remove tabs. help LuisXVI Word VBA 4 11-12-2018 03:12 PM
Setting tabs relative to block of text kirkm Word 8 09-06-2016 07:54 PM
Pulling 2 digits before a decimal point from adjoining cell then zeros after decimal jadess916 Excel 1 06-26-2014 03:48 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:59 PM.


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