• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Compile error about multiline initializtion of date array

craigvan888

New Member
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:

craigvan888

As You have read
  • Cross-Posting. Generally, it is considered poor practice to cross post. That is to post the same question on several forums in the hope of getting a response quicker.
  • If you do cross-post, please put that in your post.
  • Also if you have cross-posted and get an Solution elsewhere, have the courtesy of posting the Solution here so other readers can learn from the answer also, as well as stopping people wasting their time on your answered question.
from
Which are for everyone.
 
Back
Top