Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-28-2020, 03:45 AM
bpike bpike is offline Deleting a table with vertically merged cells if it contains certain text. Windows 10 Deleting a table with vertically merged cells if it contains certain text. Office 2019
Novice
Deleting a table with vertically merged cells if it contains certain text.
 
Join Date: Oct 2020
Posts: 8
bpike is on a distinguished road
Default Deleting a table with vertically merged cells if it contains certain text.

I received help earlier on this forum regarding splitting a Table containing vertically merged cells. I am now needing to search each table within the active document to find a certain text string within a cell e.g. "DelTbl". If the string is located I would then like to delete the table from which the string was found. I'm having a little trouble getting my head around the merged cells so any help will be much appreciated.



Thanks.
Reply With Quote
  #2  
Old 10-28-2020, 04:27 AM
macropod's Avatar
macropod macropod is offline Deleting a table with vertically merged cells if it contains certain text. Windows 10 Deleting a table with vertically merged cells if it contains certain text. Office 2010
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

The F/R code I posted in your other thread (https://www.msofficeforums.com/word-...ged-cells.html) would require very little change to delete the table instead of splitting it. Indeed, it could be done with 6 fewer lines of code...
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 10-28-2020, 04:42 AM
bpike bpike is offline Deleting a table with vertically merged cells if it contains certain text. Windows 10 Deleting a table with vertically merged cells if it contains certain text. Office 2019
Novice
Deleting a table with vertically merged cells if it contains certain text.
 
Join Date: Oct 2020
Posts: 8
bpike is on a distinguished road
Default

Okay thank you, I shall persevere.
Reply With Quote
  #4  
Old 10-30-2020, 12:45 AM
macropod's Avatar
macropod macropod is offline Deleting a table with vertically merged cells if it contains certain text. Windows 10 Deleting a table with vertically merged cells if it contains certain text. Office 2010
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Replace:
"Tree Number"
with:
"DelTbl"
and replace:
Code:
    If .Information(wdWithInTable) = True Then
      With .Cells(1)
        If .RowIndex > 1 Then
          If Split(.Range.Text, vbCr)(0) = StrFnd Then .Range.InsertBreak (wdColumnBreak)
        End If
      End With
    End If
with:
Code:
    If .Information(wdWithInTable) = True Then .Tables(1).Delete
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 10-30-2020, 10:28 PM
bpike bpike is offline Deleting a table with vertically merged cells if it contains certain text. Windows 10 Deleting a table with vertically merged cells if it contains certain text. Office 2019
Novice
Deleting a table with vertically merged cells if it contains certain text.
 
Join Date: Oct 2020
Posts: 8
bpike is on a distinguished road
Default

Thanks Paul, is now working correctly.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Finding Tables with Vertically Merged Cells T-Belle Word VBA 10 07-19-2020 07:09 PM
Deleting a table with vertically merged cells if it contains certain text. Converting table to text (and back) with carriage returns in cells, split and merged cells ndajko Word 5 11-04-2019 07:53 AM
Deleting a table with vertically merged cells if it contains certain text. Format tables with vertically merged cells jeffreybrown Word VBA 2 01-16-2019 03:23 PM
Unmerging vertically merged cells kilroy Word VBA 5 01-12-2018 12:54 PM
Deleting a table with vertically merged cells if it contains certain text. Overcome issues in tables with vertically merged cells rocky2 Word VBA 12 12-22-2016 03:03 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:13 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft