L
LycanT
Hi,
Help, I'm stuck
I want to delete the tables from a word document that contain the
words "GEAR CHANGES".
Unfortunately this document is updated on a daily basis and there
could be 10 tables tomorrow and 3 the next.
I've managed to figure out how to get the first one deleted but I'm
not clever enough to figure out what commands are required to get it
to carry on till all tables are deleted.
This is what I have:
Sub DeleteTable()
'
'Delete Tables with GEAR CHANGES inside it.
'
With Selection.Find
.Text = "GEAR GHANGES"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.Tables(1).Select
Selection.Tables(1).Delete
Can I make it loop till it cant find anymore then carry on with the
rest of the macro?
Cheers
Andrew
Help, I'm stuck
I want to delete the tables from a word document that contain the
words "GEAR CHANGES".
Unfortunately this document is updated on a daily basis and there
could be 10 tables tomorrow and 3 the next.
I've managed to figure out how to get the first one deleted but I'm
not clever enough to figure out what commands are required to get it
to carry on till all tables are deleted.
This is what I have:
Sub DeleteTable()
'
'Delete Tables with GEAR CHANGES inside it.
'
With Selection.Find
.Text = "GEAR GHANGES"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.Tables(1).Select
Selection.Tables(1).Delete
Can I make it loop till it cant find anymore then carry on with the
rest of the macro?
Cheers
Andrew