J
JVLennox
Hi everybody,
I want to captalize the first letter of the FIRST word in each cell of
a column.
The cell contains something like this:
a anterior view
b first cervical vertebra (atlas)
...
I'd like to habe the FIRST LETTER OF THE FIRST WORD capitalized.
(not the first letter a, b or c)
I have this code, but it does it for ALL words.
How can one stop it from doing that?
Code:
--------------------
Sub First_Letter_Cap()
i = CInt(InputBox("Which column" & vbLf & " A=1, B=2,..", "Question", "1"))
For Each cell In Worksheets("Sheet2").Columns(i).SpecialCells(xlCellTypeConstants, 2)
strText = cell.Value
Trennzeichen = " "
posStart = InStr(1, strText, Trennzeichen)
part2 = Mid(strText, posStart + 1)
part1 = Left(strText, posStart)
cell.Value = part1 & Trim(WorksheetFunction.Proper(part2))
Next cell
End Sub
I want to captalize the first letter of the FIRST word in each cell of
a column.
The cell contains something like this:
a anterior view
b first cervical vertebra (atlas)
...
I'd like to habe the FIRST LETTER OF THE FIRST WORD capitalized.
(not the first letter a, b or c)
I have this code, but it does it for ALL words.
How can one stop it from doing that?
Code:
--------------------
Sub First_Letter_Cap()
i = CInt(InputBox("Which column" & vbLf & " A=1, B=2,..", "Question", "1"))
For Each cell In Worksheets("Sheet2").Columns(i).SpecialCells(xlCellTypeConstants, 2)
strText = cell.Value
Trennzeichen = " "
posStart = InStr(1, strText, Trennzeichen)
part2 = Mid(strText, posStart + 1)
part1 = Left(strText, posStart)
cell.Value = part1 & Trim(WorksheetFunction.Proper(part2))
Next cell
End Sub