#1
|
|||
|
|||
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. |
#2
|
||||
|
||||
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 |
#3
|
|||
|
|||
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. |
#4
|
||||
|
||||
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 |
#5
|
|||
|
|||
Brilliant! That works, thanks! :-)
|
#6
|
|||
|
|||
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. |
#7
|
|||
|
|||
Sorry, this code does indeed work. My expression was wrong.
Ignore me! Thanks. |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
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 |
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 |
Day and Month to Uppercase | Andy2011 | Word VBA | 1 | 07-22-2011 04:34 PM |