Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 04-11-2024, 01:49 AM
Guessed's Avatar
Guessed Guessed is offline VBA Find last cell in Column 2 of Word table Windows 10 VBA Find last cell in Column 2 of Word table Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA Find last cell in Column 2 of Word table What formula can I use to find the lowest cell in a column that has a value in it? EddyWD Excel 3 04-20-2016 09:29 PM
VBA Word - Find Specific Table - Prepend & Append Data to Each Cell jc491 Word VBA 3 12-02-2015 09:48 PM
VBA Find last cell in Column 2 of Word table VBA Table – Search All Tables - Find & Replace Text in Table Cell With Specific Background Color jc491 Word VBA 8 09-30-2015 06:10 AM
Find text within cell and return column and row title next to the name on a new sheet. tanyabowring@live.co.uk Excel Programming 2 03-26-2015 01:48 AM
How do I reference a merged cell in a multi column & row table in MS Word ('03')? jihanemo Word Tables 0 03-18-2009 08:33 AM

Other Forums: Access Forums

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