Results 1 to 2 of 2
  1. #1
    New Lounger
    Join Date
    Jun 2005
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Change Case to Mixed (Excel 2003)

    I found this macro on-line. When I run it, it keeps giving me a syntax error. I cannot find the error.

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Change Case to Mixed (Excel 2003)

    This should eliminate the syntax errors:

    <pre>Sub ChangeCase()
    Dim MemberCell As Range
    Dim BottomRow As Integer
    Dim k As Integer

    Windows(ThisNewSheet).Activate
    Application.StatusBar = "Changing case..."
    Range("A2").Select
    BottomRow = ActiveCell.SpecialCells(x1LastCell).Row
    Cells.Replace What:="MC", Replacement:="MC ", LookAt:=x1Part, _
    SearchOrder:=x1ByRows, MatchCase:=False
    Cells.Replace What:="'", Replacement:="'", LookAt:=x1Part, _
    SearchOrder:=x1ByRows, MatchCase:=False
    For k = 2 To BottomRow
    Cells(k, 1).Value = Application.Proper(Cells(k, 1).Value)
    Next
    Range("A2").Select

    ActiveCell.Offset(1, 0).Select
    End Sub
    </pre>


    However, I see a number of other possible problems with the macro, depending on the workbook you are trying to use it in and what you are trying to do.
    Legare Coleman

Posting Permissions

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