In Excel VBA I couldn't change all occurrences between {MyText} to lowercase.
I have been browsing the whole column A & B and each time I found a text between {} I change it to lowercase.
The code I had works only on the first occurrence but when there are multiple occurrences in the cell I would not be able to change all of them to lowercase.
as e.g. in a cell we had "Bla Bla Bla {Abc} bla bla {xYz} and {HELLO}"
I would have as a result "Bla Bla Bla {abc} bla bla {xYz} and {HELLO}"
However I am expecting to have it like this:
"Bla Bla Bla {abc} bla bla {xyz} and {hello}"
Even if I run the code again it is applying only on the first occurrence this below is the VBA I had:
Set MyRange = Worksheets("Sheet1").Range("G:G,H:H")
Dim temp As String
For Each c In MyRange
If c.Value Like "*{*" Then
temp = Split(c.Value, "{")(1)
temp = Split(temp, "}")(0)
c.Value = Replace(c.Value, temp, LCase(temp))
Else
End If
Next c
End Sub