【发布时间】:2014-02-24 02:46:36
【问题描述】:
对此完全感到困惑,我想将列中的名称转换为正确的大小写,但我不想更改标题。
如何转换为正确的大小写直到第一个,
BOB FEGESON
Sally Ran, Ph.D.
GREG HYMAN, MA, CPCC
我明白了
Bob Fegeson
Sally Ran, Ph.d.
Greg Hyman, Ma, Cpcc
想要
Bob Fegeson
Sally Ran, Ph.D.
Greg Hyman, MA, CPCC
谢谢
如果If InStr(cell.Formula, ",") > 0,这将转换为正确的大小写
Sub FindChr()
Dim rAcells As Range
Dim rLoopCells As Range
Dim lReply As Long
Dim myRange As Range
Dim cell As Range
'Set variable to needed cells
Set rAcells = Range("D2", Range("D" & Rows.Count).End(xlUp))
Set rAcells = rAcells.SpecialCells(xlCellTypeConstants, xlTextValues)
Set myRange = Range("D2", Range("D" & Rows.Count).End(xlUp))
For Each cell In myRange
If InStr(cell.Formula, ",") > 0 Then
"Cant Not Figure out what goes here"
Else
' Convert to Proper Case
For Each rLoopCells In rAcells
rLoopCells = StrConv(rLoopCells, vbProperCase)
Next rLoopCells
End If
Next cell
End Sub
【问题讨论】: