Macro with Find method results in compile error in Excel for Mac

Article translations Article translations
Article ID: 189895 - View products that this article applies to.
This article was previously published under Q189895
This article has been archived. It is offered "as is" and will no longer be updated.
Expand all | Collapse all

SYMPTOMS

When you run a Visual Basic for Applications macro in Microsoft Excel for Mac, you receive the following error message:
Compile error:
Named argument not found

CAUSE

This problem may occur if the following conditions are true:
  • You used the macro recorder to create some or all of your Visual Basic macro.

    -and-
  • You recorded a usage of the Find command on the Edit menu.

WORKAROUND

Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.
To work around the problem, you need to change the syntax of the Find method in your Visual Basic macro. For example, the macro recorder may create a line of code that is similar to the following:
   Cells.Find What:="Test", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
      :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
      MatchCase:=False, Activate:=True
				
You must change this line of code to the following:
   Cells.Find(What:="Test", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
      :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
      MatchCase:=False).Activate
				

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

Properties

Article ID: 189895 - Last Review: March 4, 2014 - Revision: 4.0
APPLIES TO
  • Microsoft Excel 2004 for Mac
  • Microsoft Excel X for Mac
  • Microsoft Excel 2001 for Mac
  • Microsoft Excel 98 for Macintosh
Keywords: 
kbnosurvey kbarchive kbbug kberrmsg kbpending KB189895

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com