x = "hello, how are you?"
I want the first character in x to be capital each time. So that it makes -
x = "Hello, how are you?"
How do I do that? Supose I want to put a "." at the end of every variable, how do I do that? Thanks
Printable View
x = "hello, how are you?"
I want the first character in x to be capital each time. So that it makes -
x = "Hello, how are you?"
How do I do that? Supose I want to put a "." at the end of every variable, how do I do that? Thanks
Dim hold As String
'to change the first letter to a capital
'using the form caption as an example
hold = Left(Me.Caption, 1)
hold = UCase(hold)
Me.Caption = hold & Right(Me.Caption, Len(Me.Caption) - 1)
'to put a full stop at the end
Me.Caption = Me.Caption & "."
Bigley's answer works just fine, but it's easier than that.
Me.Caption = UCase(Left(Me.Caption, 1)) & Right(Me.Caption, Len(Me.Caption) - 1) & "."
(or substitute x for Me.Caption)
------------------
Marty
What did the fish say when it hit the concrete wall?
> > > > > "Dam!"