📜  在 excel 中获取字符串的首字母 - 任何代码示例

📅  最后修改于: 2022-03-11 14:56:30.309000             🧑  作者: Mango

代码示例1
Function FirstCharacters(pWorkRng As Range) As String
'Updateby20140514
Dim arr As Variant
Dim xValue As String
Dim OutValue As String
xValue = pWorkRng.Value
arr = VBA.Split(Trim(xValue))
For i = 0 To UBound(arr)
    OutValue = OutValue & VBA.Left(arr(i), 1) & "."
Next
FirstCharacters = OutValue
End Function