+ Reply to Thread
Results 1 to 2 of 2

Excel VBA - Check/Format String

  1. #1
    magix
    Guest

    Excel VBA - Check/Format String

    Hi,

    I would like to check and format string from a cell if a condition is met,
    via using macro button.
    Condition: if there is apostrophe in that string, the following letter
    after apostrophe must be lowercase. if the following letter is a space, then
    nothing happen.

    Of course, if I select multiple cells, it will check each of them.

    Thanks in advance.

    Regards,
    Magix



  2. #2
    Bob Phillips
    Guest

    Re: Excel VBA - Check/Format String


    Dim cell As Range
    Dim iPos As Long

    For Each cell In Selection
    iPos = InStr(cell.Value, ",")
    If iPos > 0 Then
    cell.Value = Left(cell.Value, iPos) & _
    UCase(Mid(cell.Value, iPos + 1, 1)) & _
    Right(cell.Value, Len(cell.Value) - iPos -
    1)
    End If
    Next cell


    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "magix" <[email protected]> wrote in message
    news:[email protected]...
    > Hi,
    >
    > I would like to check and format string from a cell if a condition is met,
    > via using macro button.
    > Condition: if there is apostrophe in that string, the following letter
    > after apostrophe must be lowercase. if the following letter is a space,

    then
    > nothing happen.
    >
    > Of course, if I select multiple cells, it will check each of them.
    >
    > Thanks in advance.
    >
    > Regards,
    > Magix
    >
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1