Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-09-2022, 04:58 PM
Guessed's Avatar
Guessed Guessed is offline Define range within word table between specific text instance and end of cell content Windows 10 Define range within word table between specific text instance and end of cell content 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


Try this code
Code:
Sub TableSplitter()
  Dim aTbl As Table, i As Integer, sVal As String, sValPrev As String
  
  Set aTbl = Selection.Tables(1)
  For i = aTbl.Rows.Count To 3 Step -1
    On Error Resume Next
      sVal = Split(aTbl.Rows(i).Cells(1).Range.Text, ".")(1)
      sValPrev = Split(aTbl.Rows(i - 1).Cells(1).Range.Text, ".")(1)
    On Error GoTo 0
    Debug.Print "Row:" & i, sVal, sValPrev
    If sVal = sValPrev Then
      GoTo Jumper
    Else
      aTbl.Split i
    End If
Jumper:
  Next i
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Define range within word table between specific text instance and end of cell content How to change the font color of specific text within a Word table cell epid011 Word Tables 2 05-15-2017 05:21 PM
Define range within word table between specific text instance and end of cell content How do I add selection of multi line content control list to specific table cell Dudlee Word VBA 1 09-20-2016 04:58 PM
Define range within word table between specific text instance and end of cell content 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
Define range within word table between specific text instance and end of cell content Creating a plain text content control for every instance of a word or phrase RobsterCraw Word VBA 16 11-20-2012 03:25 PM
Define range within word table between specific text instance and end of cell content Word VBA: Cannot Edit Range (Delete characters except the first in a table cell) tinfanide Word VBA 3 04-27-2012 09:48 AM

Other Forums: Access Forums

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