StrConv first character inside ()

  • Thread starter Thread starter shank
  • Start date Start date
S

shank

I'm using StrConv to set my string to proper case, but the first character
inside a parenthesis is lower case.
How can I set them to Upper case?
thanks!
 
This is a bit tricky. Will each string have a string inside parentheses? Or
just some?

My first approach would be to use additional VBA code steps to handle this
situation:

Dim intLoc As Integer
StringVariable = StrConv(StringVariable, vbProperCase)
intLoc = InStr(StringVariable, "(")
If intLoc > 0 Then StringVariable = Left(StringVariable, intLoc) & _
Replace(Mid(StringVariable, intLoc + 1, 1), _
UCase(Mid(StringVariable, intLoc + 1, 1)) & _
Mid(StringVariable, intLoc + 2)
 
Sorry -- just saw a typo in my post:

Dim intLoc As Integer
StringVariable = StrConv(StringVariable, vbProperCase)
intLoc = InStr(StringVariable, "(")
If intLoc > 0 Then StringVariable = Left(StringVariable, intLoc) & _
Replace(Mid(StringVariable, intLoc + 1, 1), _
UCase(Mid(StringVariable, intLoc + 1, 1)), , , vbTextCompare) & _
Mid(StringVariable, intLoc + 2)
 
Back
Top