#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 79
Default Macro Error

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Macro Error

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." wrote in message
...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 79
Default Macro Error

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." wrote in message
...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Macro Error

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." wrote in message
...
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." wrote in message
...
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable Enda80 Excel Worksheet Functions 1 May 3rd 08 02:35 PM
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable Enda80 Excel Discussion (Misc queries) 1 May 3rd 08 10:52 AM
Excel 2003 Macro Error - Runtime error 1004 Cow Excel Discussion (Misc queries) 2 June 7th 05 01:40 PM
naming tab macro error runtime error 1004 D Excel Programming 3 February 28th 05 01:32 AM
Macro 'Automation error' with ChemOffice Excel macro Stew Excel Programming 0 October 27th 03 08:26 PM


All times are GMT +1. The time now is 09:15 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"