Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 06-04-2022, 07:09 PM
Cendrinne's Avatar
Cendrinne Cendrinne is offline Help, with Script to right Indent align if found tx ) Windows 10 Help, with Script to right Indent align if found tx ) Office 2019
Competent Performer
Help, with Script to right Indent align if found tx )
 
Join Date: Aug 2019
Location: Montreal Quebec Canada
Posts: 200
Cendrinne is on a distinguished road
Exclamation Help, with Script to right Indent align if found tx )

Hello Pros,


I've been trying and to no avail. Need hint to figure out why my script doesn't do anything.

I'm glad I don't have an error message, but I'm hoping if the cell has a number with a bracket, then have the cell have a Right indent of 0.04.

Code:
Dim xTbl As Table
Dim aCel As Cell
Dim oRng As Range
  
Application.ScreenUpdating = False

For Each xTbl In ActiveDocument.Range.Tables
  For Each aCel In xTbl.Range.Cells

     'If aCel.Range.Characters.Last = ")" Then  'I've tried this but to no aval
      If aCel.Range.Text = ")" Then
        If aCel.Range.ParagraphFormat.RightIndent <> (0.04) Then
        aCel.Range.ParagraphFormat.RightIndent = InchesToPoints(0.04)
        End If
      End If
 
  Next aCel

Next
  Application.ScreenUpdating = True
  Application.ScreenRefresh
  DoEvents
  
lbl_Exit:
  Set xTbl = Nothing
  Set oRng = Nothing
  Exit Sub
  
  On Error GoTo 0
Ideally, as of column 2, meaning if my column 1 has bla bla text which included a number in parentheses, then disregard it.

Any insights? Is it doable?

I would be so appreciative. Spent all day on this issue.

Thanks for any idea or insights.

Cendrinne

Last edited by Cendrinne; 06-05-2022 at 12:21 PM.
Reply With Quote
 

Tags
alignment, all tables, help please



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help, with Script to right Indent align if found tx ) Help Please, IF with Selected Paragraph Format & Left Indent with First Line Indent Cendrinne Word VBA 3 03-06-2022 04:42 AM
Need Help to Script to align all the tables only as of a section to end of doc? Cendrinne Word VBA 4 04-05-2021 11:37 AM
Using numbered list style, how to indent text immediately following heading to match heading indent? SpechtacularDave Word 3 09-25-2019 01:22 PM
Difference between first line Indent and Left Indent kingston123 Word 3 09-25-2018 02:47 PM
Help, with Script to right Indent align if found tx ) vba script to align text to the center olybobo Excel Programming 1 05-26-2016 01:09 AM

Other Forums: Access Forums

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