Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA/First character as capital 1

Status
Not open for further replies.

jdol

Programmer
Jan 2, 2002
7
0
0
NL
Hello,

I'm looking for a function in VBA to present the first character of a word as a capital.
In the Dutch-version of Excel2000 exist the function "BEGINLETTERS(A1)" that presents the first characters of all words in cell A1 as a capital, and that's exact what I'm looking for.
But now, I will do the same using a macro. Is there a similar function in VBA to do this?

Jan D.
 
There is "StrConv" as in
Code:
StrConv ( "make capital", 3 )
returns "Make Capital
 
Thanks Golom, that's what I was looking for!!

Jan D.
 
I tried the code, but when I use it I get Compile error: Expected:=
Why?
Also, what do I replace "make capital" with to change the entire sheet?
 
CBFISH,

next macro will do that in a selection, p.e. Sheet1!A1:F12

Sub MakeCapital()
Range("Sheet1!A1:F12").Select
For Each cell in Selection
cell.Value = StrConv(cell.Value, 3)
Next
End Sub

That's all

Jan D.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top