Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 09-13-2015, 08:51 AM
peligroso peligroso is offline vba find numbers in document and align text left Windows 8 vba find numbers in document and align text left Office 2013
Novice
vba find numbers in document and align text left
 
Join Date: Sep 2015
Posts: 6
peligroso is on a distinguished road
Default vba find numbers in document and align text left

I am calling a embedded word document from excel and populating it with tables from excel with financial data to produce a report.

When the tables are copied into word the numbers contain leading spaces that are spoiling the formatting. I have written the code to strip out the leading spaces however the data is still left justified rather than right justified.

I am trying to use the following code using wildcards to locate any financial numbers and left justify them however I am off the mark as the code 1) removes the financial numbers and 2) does not justify.

With wrdObj
.Content.SelectAll
With .Selection.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "*.[0-9][0-9]"
.MatchWildcards = True


.Wrap = wdFindContinue
.Execute Replace:=wdReplaceAll
If .Found = True Then .Parent.Font.Alignment = wdAlignParagraphRight
End With
End with


Any help appreciated.
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
vba find numbers in document and align text left How to either move document display to right or left; or reduce size of find/replace window. pmstock Word 2 08-02-2014 08:34 PM
vba find numbers in document and align text left Find and Replace function shooting off screen to the left of the document Mattblack Word 1 04-10-2014 03:06 PM
vba find numbers in document and align text left Align...both left and right? supersimu Word 1 01-25-2014 02:05 AM
vba find numbers in document and align text left Numbers on the left side of the text Felipe Word 2 04-19-2012 07:35 AM
vba find numbers in document and align text left How to align page to left side instead of centre ghumdinger Word 2 08-18-2011 10:15 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:18 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