• Case converter or Macro for change case

    Case converter or Macro for change case

    Hi all Here in my office I have to change case of multiple ranges on daily bases, it`s very time consuming. So to solve this I create a macro , it`s very fast. You can also try this,

    Just paste this code in your module and save.

    Case converter or Macro for change case

    Always save this file as Macro Enabled Excel Workbook
                                                                                                                                                        

    'case converter By Vikash
    Sub CaseConverterByVikash()
    'case converter By Vikash
    Dim ocell As Range, ans As String

    ans = Application.InputBox("Type in Letter" & vbCr & _
        "(L)owercase, (U)ppercase, (S)entence, (T)itles ")

    If ans = "" Then Exit Sub

    For Each ocell In Selection.SpecialCells(xlCellTypeConstants, 2)
        Select Case UCase(ans)
            Case "L": ocell = LCase(ocell.Text)
            Case "U": ocell = UCase(ocell.Text)
            Case "S": ocell = UCase(Left(ocell.Text, 1)) & _
                LCase(Right(ocell.Text, Len(ocell.Text) - 1))
            Case "T": ocell = Application.WorksheetFunction.Proper(ocell.Text)
        End Select
    Next

    End Sub

    .                                                                                                                                                           

    Always open this file to perform this Macro

    You can Also Download Exercise file from here Case converter or Macro for change case

    Thanks in advance.
  • 0 comments:

    Post a Comment

    GET A FREE QUOTE NOW

    Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.

    ADDRESS

    4759, NY 10011 Abia Martin Drive, Huston

    EMAIL

    contact-support@mail.com
    another@mail.com

    TELEPHONE

    +201 478 9800
    +501 478 9800

    MOBILE

    0177 7536213 44,
    017 775362 13