+ Reply to Thread
Results 1 to 4 of 4

Compile error (Constant expression required) when using macro twice

  1. #1
    Registered User
    Join Date
    04-10-2013
    Location
    Belgium
    MS-Off Ver
    Excel 2010
    Posts
    76

    Compile error (Constant expression required) when using macro twice

    Hi guys,

    I'm trying to use the macro below (twice but with different variables) but everytime I get the error "Compile error: Constant expression required". Does anyone know why?

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

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,660

    Re: Compile error (Constant expression required) when using macro twice

    At a first glance - try changing [E1] (and N1 in next one) to
    Please Login or Register  to view this content.
    you do this within scope of With Sheets("Totaal") while form: [address] refers to active sheet.
    Best Regards,

    Kaper

  3. #3
    Registered User
    Join Date
    04-10-2013
    Location
    Belgium
    MS-Off Ver
    Excel 2010
    Posts
    76

    Re: Compile error (Constant expression required) when using macro twice

    Dear Kaper,

    I've tried it but unfortunatly I get the error "type doesn't match". Any other ideas?

  4. #4
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,660

    Re: Compile error (Constant expression required) when using macro twice

    Hi,
    I tried several times, but dont get the error.
    So probably attachment would make further studying this case easier.

+ 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: Expected: expression
    By Wheelie686 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-30-2013, 08:51 AM
  2. [SOLVED] Compile error: Constant expression required error when merging two Codes
    By Kezwick in forum Outlook Programming / VBA / Macros
    Replies: 8
    Last Post: 06-26-2013, 09:32 AM
  3. [SOLVED] Compile Error: Expected Expression, Syntax Error
    By gjohn282 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-20-2012, 11:28 PM
  4. Compile error: Object required
    By Hinnerk in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 07-23-2012, 04:38 PM
  5. creating a public constant by concatenating string......gives compile error
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-26-2011, 07:23 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