Below is the Excel VBA code to capitalize each word of a string.
'macro to capitalize each word of a string
exString = "helLo how Are yOU" ' Example string
stringAfterCapitalized = StrConv(exString, vbProperCase) ' capitalizing each word of the string
MsgBox ("string after its each word is capitalized is - " + stringAfterCapitalized)