Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-31-2019, 06:17 AM
Helend269 Helend269 is offline Change [UPPERCASE to [lowercase? Windows 7 32bit Change [UPPERCASE to [lowercase? Office 2003
Novice
Change [UPPERCASE to [lowercase?
 
Join Date: Aug 2017
Posts: 15
Helend269 is on a distinguished road
Default Change [UPPERCASE to [lowercase?

I've done a search for this in past posts but I couldn't find anything similar.


I'd like to be able to run a macro that changes the first character of all words in a document that follows all instances of [ to lowercase. So, [Apple becomes [apple, etc.





How would I do this, please? Thank you.
Reply With Quote
  #2  
Old 05-31-2019, 06:27 AM
gmayor's Avatar
gmayor gmayor is offline Change [UPPERCASE to [lowercase? Windows 10 Change [UPPERCASE to [lowercase? 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

Code:
Sub Macro1()
Dim oRng As Range
    Set oRng = ActiveDocument.Range
    With oRng.Find
        Do While .Execute(FindText:="[")
            oRng.End = oRng.End + 1
            oRng.Text = LCase(oRng.Text)
            oRng.Collapse 0
        Loop
    End With
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
  #3  
Old 05-31-2019, 06:40 AM
Helend269 Helend269 is offline Change [UPPERCASE to [lowercase? Windows 7 32bit Change [UPPERCASE to [lowercase? Office 2003
Novice
Change [UPPERCASE to [lowercase?
 
Join Date: Aug 2017
Posts: 15
Helend269 is on a distinguished road
Default

The reason I want it as a macro rather than a wildcard replacement is I have a macro of macros that I run and it does several things at once. I'll try incorporating your idea into a normal search/replace macro and see what happens...


...doesn't work.
I changed All Caps to All Lower and it didn't work.
Reply With Quote
  #4  
Old 05-31-2019, 06:41 AM
gmayor's Avatar
gmayor gmayor is offline Change [UPPERCASE to [lowercase? Windows 10 Change [UPPERCASE to [lowercase? 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

I have changed the message to a macro.
__________________
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
  #5  
Old 05-31-2019, 06:49 AM
Helend269 Helend269 is offline Change [UPPERCASE to [lowercase? Windows 7 32bit Change [UPPERCASE to [lowercase? Office 2003
Novice
Change [UPPERCASE to [lowercase?
 
Join Date: Aug 2017
Posts: 15
Helend269 is on a distinguished road
Default

Brilliant! That works, thanks! :-)
Reply With Quote
  #6  
Old 09-20-2021, 02:08 PM
RTNoble RTNoble is offline Change [UPPERCASE to [lowercase? Windows 10 Change [UPPERCASE to [lowercase? Office 2019
Novice
 
Join Date: Sep 2021
Posts: 2
RTNoble is on a distinguished road
Default

Hi there.


Sorry to resurrect such an old thread.


Is there any way to adapt the code shown here to work on any and all text found between custom delimiters?


To use the example here, I would be finding *Apple* and *Google*.


Many thanks.
Reply With Quote
  #7  
Old 09-21-2021, 04:26 PM
RTNoble RTNoble is offline Change [UPPERCASE to [lowercase? Windows 10 Change [UPPERCASE to [lowercase? Office 2019
Novice
 
Join Date: Sep 2021
Posts: 2
RTNoble is on a distinguished road
Default

Sorry, this code does indeed work. My expression was wrong.


Ignore me!


Thanks.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change [UPPERCASE to [lowercase? Word macro to change ALL CAPS to UPPERCASE dita Word VBA 14 05-20-2018 10:56 PM
How do I auto-correct an initial letter to lowercase? Matteo Word 6 10-27-2017 06:38 AM
Change [UPPERCASE to [lowercase? Find and replace mutiple spaces between lowercase words only Dave T Word VBA 2 07-16-2015 11:23 PM
find&replace word in uppercase with word in lowercase andrei Word 3 10-03-2011 05:11 AM
Change [UPPERCASE to [lowercase? Day and Month to Uppercase Andy2011 Word VBA 1 07-22-2011 04:34 PM

Other Forums: Access Forums

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