+ Reply to Thread
Results 1 to 4 of 4

Macro Error: Compile error: Named argument not found

  1. #1
    A.S.
    Guest

    Macro Error: Compile error: Named argument not found

    Hello,
    I needed some help with a macro that used to work, but for some reason
    does not work anymore. The error that is displayed is: Compile error: Named
    argument not found.

    The macro is as follows:
    Sub First_Macro_Rate_Sheet_Comparison()
    '
    ' First_Macro_Rate_Sheet_Comparison Macro
    ' Macro recorded 3/4/2005 by Edits
    '

    '
    Cells.Replace What:="Cell", Replacement:=" - Cellular", LookAt:=xlPart, _
    SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
    ReplaceFormat:=False
    Cells.Replace What:=" - Cellularular", Replacement:=" - Cellular",
    LookAt:= _
    xlPart, SearchOrder:=xlByRows, MatchCase:=False,
    SearchFormat:=False, _
    ReplaceFormat:=False
    Cells.Replace What:="Mobile", Replacement:=" - Cellular",
    LookAt:=xlPart, _
    SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
    ReplaceFormat:=False
    End Sub

    The program stops at SearchFormat, any ideas. Any help would be appreciated.

    Thanks,
    A.S.

  2. #2
    Tom Ogilvy
    Guest

    re: Macro Error: Compile error: Named argument not found

    You aren't using those format commands. I believe they were
    added/introduced in xl2002 or 2003, so take them out.


    Sub First_Macro_Rate_Sheet_Comparison()
    '
    ' First_Macro_Rate_Sheet_Comparison Macro
    ' Macro recorded 3/4/2005 by Edits
    '

    '
    Cells.Replace What:="Cell", Replacement:=" - Cellular", LookAt:=xlPart,
    _
    SearchOrder:=xlByRows, MatchCase:=False
    Cells.Replace What:=" - Cellularular", Replacement:=" - Cellular", _
    LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
    Cells.Replace What:="Mobile", Replacement:=" - Cellular", _
    LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
    End Sub

    --
    Regards,
    Tom Ogilvy


    "A.S." <[email protected]> wrote in message
    news:[email protected]...
    > Hello,
    > I needed some help with a macro that used to work, but for some reason
    > does not work anymore. The error that is displayed is: Compile error:

    Named
    > argument not found.
    >
    > The macro is as follows:
    > Sub First_Macro_Rate_Sheet_Comparison()
    > '
    > ' First_Macro_Rate_Sheet_Comparison Macro
    > ' Macro recorded 3/4/2005 by Edits
    > '
    >
    > '
    > Cells.Replace What:="Cell", Replacement:=" - Cellular",

    LookAt:=xlPart, _
    > SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
    > ReplaceFormat:=False
    > Cells.Replace What:=" - Cellularular", Replacement:=" - Cellular",
    > LookAt:= _
    > xlPart, SearchOrder:=xlByRows, MatchCase:=False,
    > SearchFormat:=False, _
    > ReplaceFormat:=False
    > Cells.Replace What:="Mobile", Replacement:=" - Cellular",
    > LookAt:=xlPart, _
    > SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
    > ReplaceFormat:=False
    > End Sub
    >
    > The program stops at SearchFormat, any ideas. Any help would be

    appreciated.
    >
    > Thanks,
    > A.S.




  3. #3
    A.S.
    Guest

    re: Macro Error: Compile error: Named argument not found

    Hi Tom,
    Thanks for the help. However, I now get a Compile error: Syntax error. Any
    idea how to get rid of this?

    "Tom Ogilvy" wrote:

    > You aren't using those format commands. I believe they were
    > added/introduced in xl2002 or 2003, so take them out.
    >
    >
    > Sub First_Macro_Rate_Sheet_Comparison()
    > '
    > ' First_Macro_Rate_Sheet_Comparison Macro
    > ' Macro recorded 3/4/2005 by Edits
    > '
    >
    > '
    > Cells.Replace What:="Cell", Replacement:=" - Cellular", LookAt:=xlPart,
    > _
    > SearchOrder:=xlByRows, MatchCase:=False
    > Cells.Replace What:=" - Cellularular", Replacement:=" - Cellular", _
    > LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
    > Cells.Replace What:="Mobile", Replacement:=" - Cellular", _
    > LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
    > End Sub
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    > "A.S." <[email protected]> wrote in message
    > news:[email protected]...
    > > Hello,
    > > I needed some help with a macro that used to work, but for some reason
    > > does not work anymore. The error that is displayed is: Compile error:

    > Named
    > > argument not found.
    > >
    > > The macro is as follows:
    > > Sub First_Macro_Rate_Sheet_Comparison()
    > > '
    > > ' First_Macro_Rate_Sheet_Comparison Macro
    > > ' Macro recorded 3/4/2005 by Edits
    > > '
    > >
    > > '
    > > Cells.Replace What:="Cell", Replacement:=" - Cellular",

    > LookAt:=xlPart, _
    > > SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
    > > ReplaceFormat:=False
    > > Cells.Replace What:=" - Cellularular", Replacement:=" - Cellular",
    > > LookAt:= _
    > > xlPart, SearchOrder:=xlByRows, MatchCase:=False,
    > > SearchFormat:=False, _
    > > ReplaceFormat:=False
    > > Cells.Replace What:="Mobile", Replacement:=" - Cellular",
    > > LookAt:=xlPart, _
    > > SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
    > > ReplaceFormat:=False
    > > End Sub
    > >
    > > The program stops at SearchFormat, any ideas. Any help would be

    > appreciated.
    > >
    > > Thanks,
    > > A.S.

    >
    >
    >


  4. #4
    Tom Ogilvy
    Guest

    re: Macro Error: Compile error: Named argument not found

    Probably some problem you incurred in copying it from the email; word wrap
    or some such. I have made it very narrow to increase the probability of
    your success. It ran fine for me:

    Sub First_Macro_Rate_Sheet_Comparison()
    '
    ' First_Macro_Rate_Sheet_Comparison Macro
    ' Macro recorded 3/4/2005 by Edits
    '

    '
    Cells.Replace What:="Cell", _
    Replacement:=" - Cellular", _
    LookAt:=xlPart, _
    SearchOrder:=xlByRows, _
    MatchCase:=False
    Cells.Replace What:=" - Cellularular", _
    Replacement:=" - Cellular", _
    LookAt:=xlPart, _
    SearchOrder:=xlByRows, _
    MatchCase:=False
    Cells.Replace What:="Mobile", _
    Replacement:=" - Cellular", _
    LookAt:=xlPart, _
    SearchOrder:=xlByRows, _
    MatchCase:=False
    End Sub

    --
    Regards,
    Tom Ogilvy

    "A.S." <[email protected]> wrote in message
    news:[email protected]...
    > Hi Tom,
    > Thanks for the help. However, I now get a Compile error: Syntax error.

    Any
    > idea how to get rid of this?
    >
    > "Tom Ogilvy" wrote:
    >
    > > You aren't using those format commands. I believe they were
    > > added/introduced in xl2002 or 2003, so take them out.
    > >
    > >
    > > Sub First_Macro_Rate_Sheet_Comparison()
    > > '
    > > ' First_Macro_Rate_Sheet_Comparison Macro
    > > ' Macro recorded 3/4/2005 by Edits
    > > '
    > >
    > > '
    > > Cells.Replace What:="Cell", Replacement:=" - Cellular",

    LookAt:=xlPart,
    > > _
    > > SearchOrder:=xlByRows, MatchCase:=False
    > > Cells.Replace What:=" - Cellularular", Replacement:=" - Cellular", _
    > > LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
    > > Cells.Replace What:="Mobile", Replacement:=" - Cellular", _
    > > LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
    > > End Sub
    > >
    > > --
    > > Regards,
    > > Tom Ogilvy
    > >
    > >
    > > "A.S." <[email protected]> wrote in message
    > > news:[email protected]...
    > > > Hello,
    > > > I needed some help with a macro that used to work, but for some

    reason
    > > > does not work anymore. The error that is displayed is: Compile error:

    > > Named
    > > > argument not found.
    > > >
    > > > The macro is as follows:
    > > > Sub First_Macro_Rate_Sheet_Comparison()
    > > > '
    > > > ' First_Macro_Rate_Sheet_Comparison Macro
    > > > ' Macro recorded 3/4/2005 by Edits
    > > > '
    > > >
    > > > '
    > > > Cells.Replace What:="Cell", Replacement:=" - Cellular",

    > > LookAt:=xlPart, _
    > > > SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False,

    _
    > > > ReplaceFormat:=False
    > > > Cells.Replace What:=" - Cellularular", Replacement:=" - Cellular",
    > > > LookAt:= _
    > > > xlPart, SearchOrder:=xlByRows, MatchCase:=False,
    > > > SearchFormat:=False, _
    > > > ReplaceFormat:=False
    > > > Cells.Replace What:="Mobile", Replacement:=" - Cellular",
    > > > LookAt:=xlPart, _
    > > > SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False,

    _
    > > > ReplaceFormat:=False
    > > > End Sub
    > > >
    > > > The program stops at SearchFormat, any ideas. Any help would be

    > > appreciated.
    > > >
    > > > Thanks,
    > > > A.S.

    > >
    > >
    > >




+ 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