Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-10-2016, 07:34 PM
paik1002 paik1002 is offline How to do a pre-formatted find & replace Windows 7 64bit How to do a pre-formatted find & replace Office 2010 64bit
Advanced Beginner
How to do a pre-formatted find & replace
 
Join Date: Dec 2015
Posts: 63
paik1002 is on a distinguished road
Default How to do a pre-formatted find & replace

I'd like to do a search & replace for only colored text (e.g. user defined RGB code: 255 0 0) via a macro.

I know that this could be achieved without a macro, by going through a sequence of elaborate mouse clicks on the search and replace pane (more -> format -> font -> ... ). But this would be burdensome and time consuming when I have to do it numerous times for a repetitive task.

Thereby, I'd like to perform a pre-formatted find & replace by setting up the find & replace pane with font color type, preferably triggered by only a few keystrokes (macro short cut that is equivalent to a ctrl+h plus font color specification).
Attached Images
File Type: png findreplace.png (85.3 KB, 17 views)
Reply With Quote
  #2  
Old 03-10-2016, 08:28 PM
macropod's Avatar
macropod macropod is offline How to do a pre-formatted find & replace Windows 7 64bit How to do a pre-formatted find & replace Office 2010 32bit
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

Have you tried recording a macro to do this?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 03-10-2016, 09:55 PM
paik1002 paik1002 is offline How to do a pre-formatted find & replace Windows 7 64bit How to do a pre-formatted find & replace Office 2010 64bit
Advanced Beginner
How to do a pre-formatted find & replace
 
Join Date: Dec 2015
Posts: 63
paik1002 is on a distinguished road
Default

I certainly did.

1. Click on Record macro
2. Press ctrl+h (set user defined RGB values: more -> format -> font -> ... )
3. Press "cancel" to exit the find & replace pane (else the recording can't be terminated)
4. Click on Stop Recording
5. Run the created macro (but nothing happens).

FYI, the macro recording can't be terminated without pressing the cancel button, which is the real problem here. The "find what" and "replace with" fields should be left clear of course, in order to emulate the generic ctrl+h function. I don't want the macro to limit the find & replace function to a specific search text, which then would be no-brainer.
Reply With Quote
  #4  
Old 03-10-2016, 10:11 PM
macropod's Avatar
macropod macropod is offline How to do a pre-formatted find & replace Windows 7 64bit How to do a pre-formatted find & replace Office 2010 32bit
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

Well, unless you click something other than 'Cancel', Find/Replace won't do anything, so neither would your recorded macro. That, too, should be a no-brainer.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 03-10-2016, 10:42 PM
paik1002 paik1002 is offline How to do a pre-formatted find & replace Windows 7 64bit How to do a pre-formatted find & replace Office 2010 64bit
Advanced Beginner
How to do a pre-formatted find & replace
 
Join Date: Dec 2015
Posts: 63
paik1002 is on a distinguished road
Default

I already clicked for font color. If this is not then, please elaborate on your "something other than cancel?" Or are your saying that without leaving the find & replace pane, the macro recording can't be terminated?
Reply With Quote
  #6  
Old 03-10-2016, 10:50 PM
macropod's Avatar
macropod macropod is offline How to do a pre-formatted find & replace Windows 7 64bit How to do a pre-formatted find & replace Office 2010 32bit
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

Unless you click on 'Replace', 'Replace All' or 'Find Next', stead of clicking on 'Cancel', all you're doing is aborting the Find/Replace, so nothing will be recorded. If you look at your recorded code, that's what you'd see - nothing about colours, etc. - probably just an empty macro.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to do a pre-formatted find & replace VBA Word - Find Formatted Text Version Only - Replace From Table jc491 Word VBA 14 01-06-2016 08:57 PM
Macro to keep formatted form fields after mail merge or replace text with formatted form fields jer85 Word VBA 2 04-05-2015 10:00 PM
How to do a pre-formatted find & replace Find what box in Find and replace limits the length of a search term Hoxton118 Word VBA 7 06-10-2014 05:05 AM
How to do a pre-formatted find & replace Bad view when using Find and Find & Replace - Word places found string on top line paulkaye Word 4 12-06-2011 11:05 PM
How to do a pre-formatted find & replace Help with find and replace or query and replace shabbaranks Excel 4 03-19-2011 08:38 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:35 AM.


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