+ Reply to Thread
Results 1 to 4 of 4

Getting Duplicate delcaration in current scope error when trying to assign/create array

  1. #1
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,712

    Getting Duplicate delcaration in current scope error when trying to assign/create array

    Hi,

    I have the following code and when I execute it I get a "Duplicate declaration in current scope error" and I don't know why.

    Any ideas?



    Please Login or Register  to view this content.

  2. #2
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Getting Duplicate delcaration in current scope error when trying to assign/create arra

    You are missing out some lines of code?

    Lines in blue are dim-ing the same variables in red. I assume you have already dim the red variables above? Hence the error - Duplicate declaration
    Please Login or Register  to view this content.
    多么想要告诉你 我好喜欢你

  3. #3
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,712

    Re: Getting Duplicate delcaration in current scope error when trying to assign/create arra

    no I was not dimming the variables above the red text........

    here is what I assumed:
    '1-red text only accessed if Boolean set to false
    '2-blue text only accessed if Boolean set to true

    I had to re-dim in the bluetext but redtext is assigned via range.........anyway, guess I need to dim before both .......right?

  4. #4
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Getting Duplicate delcaration in current scope error when trying to assign/create arra

    Then maybe you have a loop? That's the problem I can think of.

    Actually, maybe explain what you're trying to do, people might be able to suggest a better approach.

+ 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] Duplication Declaration in Current scope
    By wonderd in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-08-2013, 06:56 AM
  2. [SOLVED] compile error: duplicate declaration in current scope
    By 3earth in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-27-2013, 04:41 PM
  3. Duplicate Declaration in Current Scope
    By TonyforVBA in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-23-2011, 08:27 AM
  4. Duplicate Decleration In Current Scope Error
    By Bono1083 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 06-27-2010, 09:28 PM
  5. Duplicate declaration in current scope
    By Turbobiker in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-31-2009, 04:31 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