View Single Post
 
Old 04-11-2024, 01:49 AM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,161
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

In your example the last cell in column 2 is also the last cell in the table. Looking at your previous question, I'm going to assume that is always the case. I'm also going to assume there are no trailing spaces on that last cell so this simple code would work.
Code:
Sub CleanseTheColon()
  Dim aTbl As Table, aRng As Range
  For Each aTbl In ActiveDocument.Tables
    Set aRng = aTbl.Range
    aRng.End = aRng.End - 2
    If aRng.Characters.Last = ";" Then aRng.Characters.Last = "."
  Next aTbl
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote