+ Reply to Thread
Results 1 to 9 of 9

macro fror 2004 not working in 2011 for mac

  1. #1
    Registered User
    Join Date
    01-13-2010
    Location
    Erskine
    MS-Off Ver
    Excel 2011 for Mac
    Posts
    34

    macro fror 2004 not working in 2011 for mac

    I have a macro that I use in 2004 and it will not run in 2011 for mac. Does anybody know if there are differences in the code used. Just to be straight about this my other macros work in 2011.

    Please Login or Register  to view this content.
    When I try to run it it turns red from line starting "Range" to "Replace What:="$3".
    Last edited by Butehawk; 11-01-2010 at 06:17 PM.

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: macro fror 2004 not working in 2011 for mac

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
    Remember what the dormouse said
    Feed your head

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: macro fror 2004 not working in 2011 for mac

    I don't have a Mac, but I'd code the one line as
    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: macro fror 2004 not working in 2011 for mac

    The second line of your Range statement starts with curly quotation marks - you need to replace that with normal ones - i.e
    Please Login or Register  to view this content.
    needs to be:
    Please Login or Register  to view this content.
    then your code is fine in 2011 (and other versions).

  5. #5
    Registered User
    Join Date
    01-13-2010
    Location
    Erskine
    MS-Off Ver
    Excel 2011 for Mac
    Posts
    34

    Re: macro fror 2004 not working in 2011 for mac

    Thanks for that but it now stops at "searchformat" with the error as "named argument not found. Any Ideas.
    Last edited by Butehawk; 11-01-2010 at 05:53 PM.

  6. #6
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: macro fror 2004 not working in 2011 for mac

    Ah, I should have tried running it rather than just compiling it. You can't use SearchFormat or ReplaceFormat as they aren't valid arguments in the new Mac VBA.

  7. #7
    Registered User
    Join Date
    01-13-2010
    Location
    Erskine
    MS-Off Ver
    Excel 2011 for Mac
    Posts
    34

    Re: macro fror 2004 not working in 2011 for mac

    Thanks Romper,
    That has fixed it. Is there a book on mac VBA that you could recommend? I am new to this.

  8. #8
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: macro fror 2004 not working in 2011 for mac

    I don't know of any Mac-specific VBA books to be honest. In prior versions of MacOffice, it was basically VBA5 with a few limitations and differences due to the platform. 2011 is supposed to be more akin to VBA6, but there are obviously some differences.

  9. #9
    Registered User
    Join Date
    01-13-2010
    Location
    Erskine
    MS-Off Ver
    Excel 2011 for Mac
    Posts
    34

    Re: macro fror 2004 not working in 2011 for mac

    Thanks again.

+ 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