Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 01-28-2023, 05:18 PM
harry harry is offline Wildcard search not working consistently Windows 10 Wildcard search not working consistently Office 2019
Advanced Beginner
Wildcard search not working consistently
 
Join Date: Jul 2010
Posts: 31
harry is on a distinguished road
Default

Thanks for your further reply. However, the issue appears to be not with the scope of the search but with the execution of the search. The search string is always found in the expected place; the issue is that when a wildcard macro is preceded by another macro, the first match is not found by the wildcard macro until the user presses Shift F4 (Find next), whereas the first match should be found immediately when the macro is run (as it is when the wildcard macro is run by itself).

The cause appears to be something to do with the end-of-document prompts that appear at the end of the preceding macro.

Test 4:
- Go to the beginning of the document.
- Run the "WildcardsFalse" macro.
- When it finds the first match (the "a" in "taxi"), type "Q" to replace it, then press Shift+F4 ("Find next").
- When it finds the next match (the "a" in "above"), press F4 ("Repeat last action") to replace it, then press Shift+F4 to continue searching.
- When it finds the next match (the "a" in "boat"), press F4 to replace it. At this point, don't press Shift+F4, so there are no end-of-document prompts.

- Go to the beginning of the document.
- Press the keyboard shortcut to run the "WildCardsTrue" macro.
- It correctly finds the first match (the "x" in "taxi"). No issue in this case.

Test 5:
- Go to the beginning of the document.
- Run the "WildcardsFalse" macro.
- When it finds the first match (the "a" in "taxi"), type "Q" to replace it, then press Shift+F4 ("Find next").
- When it finds the next match (the "a" in "above"), press F4 ("Repeat last action") to replace it, then press Shift+F4 to continue searching.
- When it finds the next match (the "a" in "boat"), press F4 to replace it, then press Shift+F4 to continue searching.
- Word displays a prompt ("We've reached the end of the document. Do you want to continue searching from the beginning?"); click on Yes.
- Word displays another prompt ("No results found" [OK]"); click on OK.

- Go to the beginning of the document.
- Press the keyboard shortcut to run the "WildCardsTrue" macro.
- Instead of finding the first matching character (the "x" in "taxi"), nothing happens; this is the issue. If you press Shift+F4 (Find next) at this point, then the first match will be found, but it should be found immediately when the macro is run (as it is when the macro is run by itself).

The essential difference between Test 4 (which doesn't have the issue) and Test 5 (which does have the issue) is that Test 4 skips the end-of-document prompts at the end of the preceding macro. (I can't skip these as a work-around, as I need to include the end-of-document prompts as part of a consistent procedure.)
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Wildcard search not working consistently Applying styles via wildcard search not working as expected Peterson Word 2 12-10-2020 06:16 PM
Wildcard Search gmaxey Word VBA 4 07-12-2020 05:13 PM
Wildcard search not working consistently Problems with wildcard search VBA MikeForward Word VBA 3 02-19-2019 03:23 PM
Wildcard search not working consistently IFERROR not (consistently) working John 1978 Excel 8 04-26-2017 12:05 AM
Wildcard search help. Kempston Word 0 11-13-2009 03:58 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:22 PM.


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