The following VBA function returns only uppercase letters. Is that normal behavior? LO ver: 6.2.7.1, os: Windows 10 (x64) hu-HU
Function FirstUpper( sString As String ) As string FirstUpper = UCase( Left( sString, 1 ) + LCase( Mid( sString, 2 ) ) End Function
In your function, UCase takes the result of LCase() too.
Insert a closing parenthesis to UCase before the +
+
FirstUpper = UCase( Left( sString, 1 ) ) + LCase( Mid( sString, 2 ) )
Thank you, I couldn’t see the forest from the tree…
Note that what happened in the original code was tdf#80731, i.e. accepting missing closing parenthesis. Unfortunately, due to wide-spread occurrences of that error, fixing that was reverted… Sad. It would prevent the problem in the first place.
So now I fixed the cause of the problem - see When Legacy Justifies Errors – Mike Kaganski's blog.