Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-02-2018, 02:17 AM
riccardo67 riccardo67 is offline macro to search * Windows 10 macro to search * Office 2013
Novice
macro to search *
 
Join Date: Nov 2018
Posts: 5
riccardo67 is on a distinguished road
Default macro to search *

I need a simple macro to search * in a word file.


I tried with registration macro, but the results was an empy macro.
I want only that the macro, by pressing the f2 key, position the cursor in the first next * the file, without any sostitution.

Then I manually replace * with the word I want digit

How can I do?

thanks in advance for the help
Reply With Quote
  #2  
Old 11-02-2018, 03:24 AM
gmayor's Avatar
gmayor gmayor is offline macro to search * Windows 10 macro to search * Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,137
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

You don't need a macro to do this. CTRL+H put * in the find box and select Find Next. If you desperately need a macro for some reason then use the macro recorder to record the search.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #3  
Old 11-02-2018, 04:04 AM
riccardo67 riccardo67 is offline macro to search * Windows 10 macro to search * Office 2013
Novice
macro to search *
 
Join Date: Nov 2018
Posts: 5
riccardo67 is on a distinguished road
Default

thanks for the attention

But:
ctrl+h doesn't open the find box (in my office)
the macro recorder doesn't write the search

This what appears after registration:
Sub Macro1()
'
' Macro1 Macro
' cerca asterisco
'
CommandBars("Navigation").Visible = False
End Sub
Reply With Quote
  #4  
Old 11-02-2018, 04:07 AM
macropod's Avatar
macropod macropod is online now macro to search * Windows 7 64bit macro to search * Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,363
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

If Ctrl-H doesn't open Word's Find/Replace dialogue, that could only be because you've modified your system. Furthermore, whatever it is you're recording, the code you posted has nothing to do with Find/Replace.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 11-02-2018, 04:46 AM
riccardo67 riccardo67 is offline macro to search * Windows 10 macro to search * Office 2013
Novice
macro to search *
 
Join Date: Nov 2018
Posts: 5
riccardo67 is on a distinguished road
Default

I have yet installed office in the new pc
I have not changed anything
in the old pc I have recorded the macro but i can't recover that

I know that the code I posted has nothing to do with find menù, but that's my result trying

Do you have something else?
Reply With Quote
  #6  
Old 11-02-2018, 06:47 AM
gmayor's Avatar
gmayor gmayor is offline macro to search * Windows 10 macro to search * Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,137
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

It is difficult to understand why the built-in command (CTRL+H) is not working but check the shortcut key assignments - http://www.gmayor.com/installing_macro.htm



If you record the macro, it should give you:
Code:
Sub Macro1()
'
' Macro1 Macro
'
'
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = "*"
        .Replacement.Text = ""
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchKashida = False
        .MatchDiacritics = False
        .MatchAlefHamza = False
        .MatchControl = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #7  
Old 11-02-2018, 07:40 AM
riccardo67 riccardo67 is offline macro to search * Windows 10 macro to search * Office 2013
Novice
macro to search *
 
Join Date: Nov 2018
Posts: 5
riccardo67 is on a distinguished road
Default

thank you a lot.
it works.
Reply With Quote
  #8  
Old 11-02-2018, 07:43 AM
riccardo67 riccardo67 is offline macro to search * Windows 10 macro to search * Office 2013
Novice
macro to search *
 
Join Date: Nov 2018
Posts: 5
riccardo67 is on a distinguished road
Default

the find box in my office open with
ctrl+shift+T

but your macro is more useful because it permit me to work automatically
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
macro to search * Macro to search for specific words in a document mike0215 Word VBA 2 11-28-2017 07:25 AM
Writing a Macro which will search for the content of a cell rather than it's value Sears36 Excel Programming 1 05-11-2017 07:55 AM
Macro on Search and Replace davidhuy Word VBA 1 12-19-2014 04:47 AM
macro to search * Macro help - search for value, paste a value in another column IRollman Excel Programming 1 01-14-2014 01:05 PM
macro to search * Word Macro to search all tables silverspr Word VBA 3 04-02-2011 11:20 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:50 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