Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 09-21-2020, 07:40 AM
2vbr 2vbr is offline Recording macro for Find Wildcard Windows 10 Recording macro for Find Wildcard Office 2013
Novice
Recording macro for Find Wildcard
 
Join Date: Sep 2020
Posts: 4
2vbr is on a distinguished road
Question Recording macro for Find Wildcard

I have a Word document of labels. Each label looks like this:



Example Label:
Quote:
Name1.
Name2
Name3
To change the font size of all the Name1's on the labels, I used FIND to highlight all text before the period. In other words...

1. use FIND
2. Tick USE WILDCARDS
2. Paste ?*.
3. Find In: Main Document

Word highlights all the text before the "." character, and I can manually change the size to what I want.

I figured I could make a button macro for this, so I clicked RECORD MACROS, performed all of the above, and then clicked STOP RECORDING.

Problem is... when I click the macro button, literally nothing happens.

I tried recording the same steps but adding one or two random actions afterwards, like pressing Enter or Space. The Macro recorded the random action, just not the Wildcard Find part.

Here's the recorded macro from VBA:

Code:
Sub Styles()
'
' Styles Macro
'
'
    Selection.Find.ClearFormatting
    With Selection.Find
        .Text = "?*."
        .Replacement.Text = ""
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchAllWordForms = False
        .MatchSoundsLike = False
        .MatchWildcards = True
    End With
    Selection.Font.Size = 32
    Selection.Find.ClearFormatting
    With Selection.Find
        .Text = "?*."
        .Replacement.Text = ""
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchAllWordForms = False
        .MatchSoundsLike = False
        .MatchWildcards = True
    End With
End Sub
Any idea what I'm doing wrong? I recorded a 60sec video of what I did, step by step:

https://i.imgur.com/6xJn6sk.mp4

Please not that I'm absolutely not a power user. My only knowledge of VBA is clicking the "Record Macro" button.
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Recording macro for Find Wildcard Wildcard to find any one or more words Maksymromaniuk Word 1 11-02-2015 01:04 PM
Need Help With Find and Replace Wildcard rsrasc Word VBA 9 10-13-2015 02:37 PM
Recording macro for Find Wildcard Find/Replace Wildcard Needed rsrasc Word VBA 4 11-11-2014 08:28 AM
Recording macro for Find Wildcard Wildcard Find and Replace Ulodesk Word 1 06-23-2014 10:26 AM
Recording macro for Find Wildcard Need help using WildCard Find & Replace Cayce Word 1 06-09-2014 04:17 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:03 PM.


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