Results 1 to 8 of 8

Thread: capitalize first letter

  1. #1

    Thread Starter
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    How do I capitalize the first word a sentence, is there a built in function to take care of it, or what?
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  2. #2
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    here one that will capitalize the first word in a text box. Is this what you want or something else?

    Private Sub Command1_Click()
    m$ = Left(Text1.Text, 1)
    c$ = UCase(m$)
    i$ = Replace(Text1.Text, m$, c$)
    Label1.Caption = i$
    End Sub

  3. #3
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    There is probably a million was to do this but i felt a
    bit creative so i went with this.



    Private Sub Command1_Click()
    Dim orgmessage As String
    Dim newmessage As String
    Dim capletter As String
    orgmessage = "hello my name is brandon"
    capletter = UCase(Left(orgmessage, 1))
    newmessage = Mid(orgmessage, 2, Len(orgmessage))
    Picture1.Print orgmessage
    Picture1.Print (capletter + newmessage)
    End Sub

  4. #4
    Member
    Join Date
    May 2000
    Location
    Canada
    Posts
    52
    Text1 = StrConv(Text1, vbProperCase)

  5. #5
    Guest
    Originally posted by d.paulson
    Text1 = StrConv(Text1, vbProperCase)
    This Will Capitalize The First Letter Of Every Word In The Sentence.

  6. #6
    New Member AffiliateSwitchblade's Avatar
    Join Date
    Mar 2016
    Location
    Torrington CT
    Posts
    3

    Lightbulb Re: capitalize first letter

    Quote Originally Posted by ;161035
    This Will Capitalize The First Letter Of Every Word In The Sentence.
    Yea Some People Don't Bother to READ!!

  7. #7
    New Member AffiliateSwitchblade's Avatar
    Join Date
    Mar 2016
    Location
    Torrington CT
    Posts
    3

    Re: capitalize first letter

    Quote Originally Posted by crptcblade View Post
    How do I capitalize the first word a sentence, is there a built in function to take care of it, or what?
    sString =UCase$(Left(sString, 1)) & Mid(sString, 2, Len(sString))

  8. #8
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,206

    Re: capitalize first letter

    Quote Originally Posted by AffiliateSwitchblade View Post
    Yea Some People Don't Bother to READ!!
    And some do not bother to read the date then respond to a 16 year old question

    But since it has been dug up here is another method that is perhaps a bit more efficient than the others given

    Code:
    Mid$(sString, 1, 1) = UCase$(Left$(sString, 1))

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width