I've used this code to delete a table if a cell was empty, but now I need to do the opposite, that is delete the table if a cell contains data.
Code:
Public Sub SHUNT()
Dim oRng1 As Range
With ActiveDocument
Set oRng1 = .Range(Start:=.Bookmarks("BK_SHUNTS").Range.End, End:=.Bookmarks("BK_SHUNTE").Range.Start)
If Len(oRng1.Tables(1).Cell(1, 1).Range) = 2 Then
oRng1.Tables(1).Delete
GoTo finish
Else
Dim t1 As Table
Set t1 = ActiveDocument.Bookmarks("BK_SHUNT").Range.Tables(1)
End If
End With
finish:
End Sub
Thank you