Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-09-2018, 04:34 AM
GemBox GemBox is offline Macro to Find & Replace Font formats for Multiple Values Windows 7 64bit Macro to Find & Replace Font formats for Multiple Values Office 2016
Novice
Macro to Find & Replace Font formats for Multiple Values
 
Join Date: Mar 2018
Posts: 4
GemBox is on a distinguished road
Thumbs up Macro to Find & Replace Font formats for Multiple Values

Dear All,



I want to write a macro to find and replace the words with Bold. For example my document will contain mutilple values like (F#m) (C), (B4), (C#m).
I want to format the font to bold only for those texts. Can you please help me out.. Please refer the attached document with Actual & Expected.

Regards,
Gem
Attached Files
File Type: docx Sample.docx (12.9 KB, 12 views)

Last edited by Charles Kenyon; 03-12-2018 at 11:49 AM. Reason: Mark as solved
Reply With Quote
  #2  
Old 03-09-2018, 07:46 AM
gmayor's Avatar
gmayor gmayor is offline Macro to Find & Replace Font formats for Multiple Values Windows 10 Macro to Find & Replace Font formats for Multiple Values Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
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 of
Default

You don't need a macro for this.
Perform a wildcard search for
\([A-Za-z0-9]{1,2}\)
replace with
^&
with ctrl+B (bold) applied in the replace dialog.
__________________
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 03-09-2018, 03:04 PM
macropod's Avatar
macropod macropod is offline Macro to Find & Replace Font formats for Multiple Values Windows 7 64bit Macro to Find & Replace Font formats for Multiple Values Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
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

Cross-posted at: https://www.excelforum.com/word-form...le-values.html

For cross-posting etiquette, please read: http://www.excelguru.ca/content.php?184
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #4  
Old 03-12-2018, 02:37 AM
GemBox GemBox is offline Macro to Find & Replace Font formats for Multiple Values Windows 7 64bit Macro to Find & Replace Font formats for Multiple Values Office 2016
Novice
Macro to Find & Replace Font formats for Multiple Values
 
Join Date: Mar 2018
Posts: 4
GemBox is on a distinguished road
Default

Quote:
Originally Posted by gmayor View Post
You don't need a macro for this.
Perform a wildcard search for
\([A-Za-z0-9]{1,2}\)
replace with
^&
with ctrl+B (bold) applied in the replace dialog.
Thank you Graham... Can you use the example as per the attached sheet, Pls...
Reply With Quote
  #5  
Old 03-12-2018, 03:27 AM
GemBox GemBox is offline Macro to Find & Replace Font formats for Multiple Values Windows 7 64bit Macro to Find & Replace Font formats for Multiple Values Office 2016
Novice
Macro to Find & Replace Font formats for Multiple Values
 
Join Date: Mar 2018
Posts: 4
GemBox is on a distinguished road
Default

Quote:
Originally Posted by gmayor View Post
You don't need a macro for this.
Perform a wildcard search for
\([A-Za-z0-9]{1,2}\)
replace with
^&
with ctrl+B (bold) applied in the replace dialog.
Graham, Your formula is not working for (F#m), (C#7), (AbM7), etc...

Can you pls check...
Reply With Quote
  #6  
Old 03-12-2018, 03:50 AM
macropod's Avatar
macropod macropod is offline Macro to Find & Replace Font formats for Multiple Values Windows 7 64bit Macro to Find & Replace Font formats for Multiple Values Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
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

You could use a wildcard Find/Replace with:
Find = \([!\(]@\)
Replace = ^&
and bold formatting applied to the Replace expression.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #7  
Old 03-12-2018, 05:24 AM
GemBox GemBox is offline Macro to Find & Replace Font formats for Multiple Values Windows 7 64bit Macro to Find & Replace Font formats for Multiple Values Office 2016
Novice
Macro to Find & Replace Font formats for Multiple Values
 
Join Date: Mar 2018
Posts: 4
GemBox is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
You could use a wildcard Find/Replace with:
Find = \([!\(]@\)
Replace = ^&
and bold formatting applied to the Replace expression.
Excellent.. Working fine... Thanks much...

Regards,
Gem
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using wildcards in Find/Replace to change font/case angie450 Word 2 05-26-2016 11:09 AM
Find and replace multiple values, according to table value - excel formula EtanM Excel Programming 3 04-11-2016 01:43 AM
Macro to Find & Replace Font formats for Multiple Values Find/replace font colour in all header/footer trillium Word VBA 4 10-20-2015 10:39 PM
Macro to Find & Replace Font formats for Multiple Values how to replace to words with multiple formats cdk270 Word 1 07-16-2015 01:56 AM
Macro for find/replace (including headers and footers) for multiple documents jpb103 Word VBA 2 05-16-2014 04:59 AM

Other Forums: Access Forums

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