+ Reply to Thread
Results 1 to 5 of 5

Compile Syntax Error - unsure whats wrong with Autofilter Label Macro

  1. #1
    Registered User
    Join Date
    07-18-2010
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2003
    Posts
    30

    Compile Syntax Error - unsure whats wrong with Autofilter Label Macro

    Hello,

    Using MS Office 2003 on Mac & I am getting Compile Syntax Error and my Sub Name is being highlighted YELLOW & all those rows listing the Autofilter Actions are highlighted RED. It not even executing the first action, the column Insert.

    Could someone please take a look & let me know if anything is obviously wrong - maybe I've been looking at it too long.

    Greatly appreciate your help & insight.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,968

    Re: Compile Syntax Error - unsure whats wrong with Autofilter Label Macro

    Do you mean you are running 2003 in a virtual machine?
    Everyone who confuses correlation and causation ends up dead.

  3. #3
    Registered User
    Join Date
    07-18-2010
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: Compile Syntax Error - unsure whats wrong with Autofilter Label Macro

    Its just MS Excel for Mac. Files work the same between Mac and PC, same functionality for everything I've ever noticed, just thought I'd mention it in case.

    If you look at it just like Excel on a PC, is there any reason why the Macro wouldn't even begin based on that code ? It is highlighting the Sub name Yellow like I have named it in the wrong format or something. And the Autofilter actions (which have always worked previously) are highlighted Red as if there is an error.

    The Debugger is highlighting the $A$1 part of the range description & saying "List Seperator or )". Even when I reduce this Range to A1:CY200 it is still highlighting those Autofilter code lines Red & giving me the same error msg.

    Very confused as I'm can't see what's wrong with code I have written.

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,968

    Re: Compile Syntax Error - unsure whats wrong with Autofilter Label Macro

    I ask because there is no Excel 2003 for Mac. There's 2001, 2004, 2008 or 2011. I assume it's not 2008 since that doesn't support VBA code at all, but given the differences between PC and Mac VBA, it's useful to know which version you actually have.

    Anyway, you appear to have some weird curly quotes in your code - did you copy it from somewhere?
    Please Login or Register  to view this content.
    should be:
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    07-18-2010
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: Compile Syntax Error - unsure whats wrong with Autofilter Label Macro

    Thanks, I will try this and let you know. Yes it is 2004 Office for Mac Student Teacher Edition. When I run it on my PC it works fine.

    I have another problem which I will be raising in a separate post.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Whats wrong with this IF syntax?
    By Destroy in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-22-2014, 02:40 PM
  2. Excel macro (compile error. syntax error.) error
    By salar_younis in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-06-2014, 06:11 AM
  3. [SOLVED] first timer using VB to cut and paste macro - getting compile error syntax error
    By jopedder in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-24-2013, 11:45 AM
  4. Syntax Error and Compile Error: Expected Line Number or Label...
    By AnthonyWB in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-31-2011, 09:59 AM
  5. Basic macro syntax error. What is wrong?
    By hunsnowboarder in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-16-2008, 04:26 AM

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