m_in_spain
Board Regular
- Joined
- Sep 28, 2018
- Messages
- 72
- Office Version
- 365
- Platform
- Windows
OK, here we go! This one (appears to me) to be more difficult.
I have a dynamic list with no blanks which i create in Column BY, like this: (thanks to this forum for parts of this)
step one deete any current Nameslike this:
Next I populate the Names from the new list like this:
Now my question.
I want to take each of those "Names" and search through my Word document for the same name and delete it, if it exists.
I can do it manually by using:
what i want to do is loop through all the names and replace the XXXxxxXXX
As ever, any ideas will be looked at, tried out but ALL will be thanked.
I have a dynamic list with no blanks which i create in Column BY, like this: (thanks to this forum for parts of this)
step one deete any current Nameslike this:
Code:
Sub DeleteNames() Dim Cell As Range
On Error Resume Next
For Each Cell In Range("BY3:BY100")
Cell.Name.Delete
Next
On Error GoTo 0
End Sub
Next I populate the Names from the new list like this:
Code:
Sub makenames()
Application.DisplayAlerts = False
Range("BY3:BZ100").Select
Selection.CreateNames Top:=False, Left:=False, Bottom:=False, Right:= _
True
Application.DisplayAlerts = True
End Sub
Now my question.
I want to take each of those "Names" and search through my Word document for the same name and delete it, if it exists.
I can do it manually by using:
Code:
docWord.bookmarks("XXXxxxXXX").Select
.Selection.Delete
what i want to do is loop through all the names and replace the XXXxxxXXX
As ever, any ideas will be looked at, tried out but ALL will be thanked.