Results 1 to 5 of 5

Compile error about multiline initializtion of date array

Threaded View

craigvan888 Compile error about multiline... 09-29-2024, 09:35 PM
JohnTopley Re: Compile error about... 09-30-2024, 03:08 AM
Greg M Re: Compile error about... 09-30-2024, 04:29 AM
mjr veverka Re: Compile error about... 09-30-2024, 06:11 AM
craigvan888 Re: Compile error about... 10-07-2024, 10:24 PM
  1. #1
    Registered User
    Join Date
    09-29-2024
    Location
    china
    MS-Off Ver
    2019
    Posts
    7

    Compile error about multiline initializtion of date array

    Hello, can anyone help me out? I want to init one big date array that could not use loop. And it has multilines. The compile failed.

    The code looks like below:

    Dim holidays As Variant
    Dim i As Long
    holidays = Array(#1/1/2024#, #2/9/2024#, #2/12/2024#, #2/13/2024#, #2/14/2024#, #2/15/2024#, #2/16/2024#, #4/4/2024#, #4/5/2024#, #5/1/2024#, #5/2/2024#, #5/3/2024#, #6/10/2024#, #9/16/2024#, #9/17/2024#, #10/1/2024#, #10/2/2024#, #10/3/2024#, #10/4/2024#, #10/7/2024#, # _
    1/1/2013#, #1/2/2013#, #1/3/2013#, #2/11/2013#, #2/12/2013#, #2/13/2013#, #2/14/2013#, #2/15/2013#, #4/4/2013#, #4/5/2013#, #4/29/2013#, #4/30/2013#, #5/1/2013#, #6/10/2013#, #6/11/2013#, #6/12/2013#, #9/19/2013#, #9/20/2013#, #10/1/2013#, #10/2/2013#, #10/3/2013#, #10/4/2013#, #10/7/2013#, # _
    1/1/2014#, #1/31/2014#, #2/3/2014#, #2/4/2014#, #2/5/2014#, #2/6/2014#, #4/7/2014#, #5/1/2014#, #5/2/2014#, #6/2/2014#, #9/8/2014#, #10/1/2014#, #10/2/2014#, #10/3/2014#, #10/6/2014#, #10/7/2014#, # _
    1/1/2015#, #1/2/2015#, #2/18/2015#, #2/19/2015#, #2/20/2015#, #2/23/2015#, #2/24/2015#, #4/6/2015#, #5/1/2015#, #6/22/2015#, #10/1/2015#, #10/2/2015#, #10/5/2015#, #10/6/2015#, #10/7/2015#, # _
    1/1/2016#, #2/8/2016#, #2/9/2016#, #2/10/2016#, #2/11/2016#, #2/12/2016#, #4/4/2016#, #5/2/2016#, #6/9/2016#, #6/10/2016#, #9/15/2016#, #9/16/2016#, #10/3/2016#, #10/4/2016#, #10/5/2016#, #10/6/2016#, #10/7/2016#, # _
    1/2/2017#, #1/27/2017#, #1/30/2017#, #1/31/2017#, #2/1/2017#, #2/2/2017#, #4/3/2017#, #4/4/2017#, #5/1/2017#, #5/29/2017#, #5/30/2017#, #10/2/2017#, #10/3/2017#, #10/4/2017#, #10/5/2017#, #10/6/2017#, # _
    1/1/2018#, #2/15/2018#, #2/16/2018#, #2/19/2018#, #2/20/2018#, #2/21/2018#, #4/5/2018#, #4/6/2018#, #4/30/2018#, #5/1/2018#, #6/18/2018#, #9/24/2018#, #10/1/2018#, #10/2/2018#, #10/3/2018#, #10/4/2018#, #10/5/2018#, #12/31/2018#, # _
    1/1/2019#, #2/4/2019#, #2/5/2019#, #2/6/2019#, #2/7/2019#, #2/8/2019#, #4/5/2019#, #5/1/2019#, #5/2/2019#, #5/3/2019#, #6/7/2019#, #9/13/2019#, #10/1/2019#, #10/2/2019#, #10/3/2019#, #10/4/2019#, #10/7/2019#, # _
    1/1/2020#, #1/17/2020#, #1/27/2020#, #1/28/2020#, #1/29/2020#, #1/30/2020#, #4/6/2020#, #5/1/2020#, #5/4/2020#, #5/5/2020#, #6/25/2020#, #6/26/2020#, #10/1/2020#, #10/2/2020#, #10/5/2020#, #10/6/2020#, #10/7/2020#, #10/8/2020#, # _
    1/1/2021#, #2/11/2021#, #2/12/2021#, #2/15/2021#, #2/16/2021#, #2/17/2021#, #4/5/2021#, #5/3/2021#, #5/4/2021#, #5/5/2021#, #6/14/2021#, #9/20/2021#, #9/21/2021#, #10/1/2021#, #10/4/2021#, #10/5/2021#, #10/6/2021#, #10/7/2021#, # _
    1/3/2022#, #1/31/2022#, #2/1/2022#, #2/2/2022#, #2/3/2022#, #2/4/2022#, #4/4/2022#, #4/5/2022#, #5/2/2022#, #5/3/2022#, #5/4/2022#, #6/3/2022#, #9/12/2022#, #10/3/2022#, #10/4/2022#, #10/5/2022#, #10/6/2022#, #10/7/2022#, # _
    1/2/2023#, #1/23/2023#, #1/24/2023#, #1/25/2023#, #1/26/2023#, #1/27/2023#, #4/5/2023#, #5/1/2023#, #5/2/2023#, #5/3/2023#, #6/22/2023#, #6/23/2023#, #9/29/2023#, #10/2/2023#, #10/3/2023#, #10/4/2023#, #10/5/2023#, #10/6/2023#)
    Thanks
    Craig
    Last edited by AliGW; 09-30-2024 at 12:40 AM. Reason: Code tags added - please review the forum guidelines.

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 Array
    By Displace1535 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-20-2024, 09:33 AM
  2. need help with error : compile error expected array
    By eggs in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-09-2017, 01:50 PM
  3. Replies: 0
    Last Post: 08-09-2017, 07:06 AM
  4. [SOLVED] Compile error: Expected Array
    By jkj115 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-27-2016, 03:01 PM
  5. [SOLVED] Compile error: expected array
    By JasperD in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-11-2015, 04:06 AM
  6. Compile Error: Expected Array
    By abfrempong in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-13-2012, 02:35 AM
  7. [SOLVED] formula array gives compile error
    By R..VENKATARAMAN in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-06-2006, 08:35 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