Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-08-2018, 10:57 AM
SidCharming SidCharming is offline Code to convert numbers to superscript Windows 10 Code to convert numbers to superscript Office 2016
Novice
Code to convert numbers to superscript
 
Join Date: Aug 2018
Posts: 2
SidCharming is on a distinguished road
Default Code to convert numbers to superscript

I have a document that is laid out like a Bible... it has a number in front of sentences. I want those numbers to be superscripted and possibly changed in color (red or blue or green). Is this possible with WORD VBA?
Reply With Quote
  #2  
Old 08-08-2018, 03:40 PM
macropod's Avatar
macropod macropod is offline Code to convert numbers to superscript Windows 7 64bit Code to convert numbers to superscript Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
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 don't need VBA for this; all you need is a wildcard Find/Replace, where:
Find = [0-9]{1,}
Replace = ^&
and you set the replacement font attributes to your preferred colour (possibly even bolded to make them stand out more) and superscripted. You could, of course, record the Find/Replace as a macro.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 08-09-2018, 08:21 AM
SidCharming SidCharming is offline Code to convert numbers to superscript Windows 10 Code to convert numbers to superscript Office 2016
Novice
Code to convert numbers to superscript
 
Join Date: Aug 2018
Posts: 2
SidCharming is on a distinguished road
Talking

Quote:
Originally Posted by macropod View Post
You don't need VBA for this; all you need is a wildcard Find/Replace, where:
Find = [0-9]{1,}
Replace = ^&
and you set the replacement font attributes to your preferred color (possibly even bolded to make them stand out more) and superscripted. You could, of course, record the Find/Replace as a macro.
Awesome! I haven't used wildcards before in Find & Replace. Thank you!!
Reply With Quote
Reply

Tags
numbers, word vba



Similar Threads
Thread Thread Starter Forum Replies Last Post
Code to convert numbers to superscript VBA code to convert Heading 1, 2, 3 etc. numbering Lady_Laughsalot Word VBA 4 04-18-2018 12:32 AM
Code to convert numbers to superscript Superscript and subscript numbers both appear as subscripts jhkemp Word 7 02-07-2018 02:41 PM
Code to convert numbers to superscript Find superscript numbers with a prefix of some default text AlexandarR Word 7 05-20-2015 07:57 AM
Search a cell that contains words and numbers and convert the numbers to metric Carchee Excel Programming 36 10-08-2014 03:16 PM
can word convert numbers? koolfire Word 2 01-07-2012 02:12 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:18 AM.


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