How do I capitalize (via macro) the first letter of a name on Calc?

Absolutely the same, but with a description and without variables:

Function Proper$(Text$)
'''	Capitalizes the first letter in all words.
'''	Text (required):
'''		The text in which the beginning of words are to be replaced by capital letters.
'''
	On Local Error GoTo Failed
	With CreateUnoService("com.sun.star.sheet.FunctionAccess")
		Proper = .callFunction("PROPER", Array(Text))
	End With
	Exit Function
Failed:
	Msgbox "#" & Err & ": " & Error, MB_ICONSTOP, "macro:Proper()"
End Function

Sub TestProper()
	Print Proper("The quick brown fox jumps over the lazy dog")
	Print Proper("")
End Sub

edit by @Karolus backtics around Codeblock

Edit: Create a ‘CalcFunctions’ module and call the appropriate function, e.g. CalcFunctions.Proper().

2 Likes

@jiml, tell me how you format a block of code (narrow font & color; I use ‘pre’ tag)?

Yeah, with all the bells and whistles!

1 Like

above the Code-block start the line with three backtics ```basic
below only three backtics

@karolus: Thanks