Capitalise first letter of words without changing currently Capitalised

。_饼干妹妹 提交于 2020-01-03 04:51:18

问题


Ive got some items of text in Excel and id like to capitalise the first letter of each word. However, a lot of text contains the phrase 'IT' and using current capitalisation methods (PROPER) it changes this to 'It'. Is there a way to only capitalise the first letter of each word without DE capitalising the other letters in each word?


回答1:


Here is a VBA way, add it to a module & =PrefixCaps("A1")

Public Function PrefixCaps(value As String) As String
    Dim Words() As String: Words = Split(value, " ")
    Dim i As Long
    For i = 0 To UBound(Words)
        Mid$(Words(i), 1, 1) = UCase$(Mid$(Words(i), 1, 1))
    Next
    PrefixCaps = Join(Words, " ")
End Function



回答2:


Used the website http://www.textfixer.com/tools/capitalize-sentences.php and pasted it all in instead




回答3:


That was all a bit complicated, but I did find if your spreadsheet is pretty simple, you can copy and paste it into word and use it's editing features and then copy and paste that back in to Excel. Worked quite well for me.



来源:https://stackoverflow.com/questions/13471146/capitalise-first-letter-of-words-without-changing-currently-capitalised

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!