Sub ConvertCamelCase()
Dim rng As Range
Dim cell As Range
Dim parts As Variant
Dim result As String
' 设置要转换的范围
Set rng = Selection
For Each cell In rng
If Not IsEmpty(cell) Then
If InStr(cell.Value, "_") > 0 Then
parts = Split(cell.Value, "_")
result = LCase(parts(0)) & UCase(Left(parts(1), 1)) & LCase(Mid(parts(1), 2))
Else
result = LCase(cell.Value)
End If
cell.Value = result
End If
Next cell
End Sub