View Single Post
 
Old 10-02-2022, 07:28 AM
macropod's Avatar
macropod macropod is offline Windows 10 Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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

Your code has no hope of working since the Find/Replace block is only run after the workbook has closed.

Furthermore, your use of:
Code:
If objExcel.ActiveWorkbook.Sheets(1).Cells(iCount, 3) = "T" Then Selection.Find.MatchWildcards = True
means that, if any cell in the range contains 'T', then all Finds will be wildcard based.

Finally, your use of 'Selection' and failure to switch off screen updating is what causes the macro to run slowly. To see how to do this properly, check out: https://www.msofficeforums.com/word-...-not-mail.html, and especially posts 5# and #6 in that thread.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]