+ Reply to Thread
Results 1 to 4 of 4

code compile error

  1. #1
    Forum Contributor
    Join Date
    06-17-2010
    Location
    Donemana, NI
    MS-Off Ver
    Excel 2007
    Posts
    386

    code compile error

    Can anyone tell me why this code is giving an error when in along with the rest of the code in the attached workbook but when its on its own works fine?

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: code compile error

    Change the name of the Day() procedure in Module1. It conflicts with the Day function.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: code compile error

    Because you named one of your Subs Day. You should never name a sub after an Excel Function.

  4. #4
    Forum Contributor
    Join Date
    06-17-2010
    Location
    Donemana, NI
    MS-Off Ver
    Excel 2007
    Posts
    386

    Re: code compile error

    Thats great thanks for the feedback. Working perfectly now.

+ 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] Compile Error VBA error code attached
    By cgibson92 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 06-01-2015, 11:07 AM
  2. code generating compile error: syntex error
    By sankarsasmal in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-10-2013, 05:29 AM
  3. [SOLVED] Compile Error in Hidden Module and Compile Error: Can't find project or library
    By Taislin in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-10-2013, 07:03 PM
  4. Compile Error in VBA Code
    By andrewc in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-22-2011, 06:49 AM
  5. VB code - compile error box help!!!
    By excel.xls in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-10-2007, 10:15 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