+ Reply to Thread
Results 1 to 6 of 6

Duplicate Declaration in the Current Scope error

  1. #1
    Forum Contributor
    Join Date
    08-19-2016
    Location
    Chennai, India
    MS-Off Ver
    2007
    Posts
    300

    Duplicate Declaration in the Current Scope error

    Dear Forum experts,

    Kindly guide me for the following error:

    I have developed a user form for data entry purpose. i have tried for two things.

    1. In the combo box (cbsitename), i have done a filter with text option. like , if i type "S" the name start with "S" will come automatically.
    2. In the combo box (cbsitename), if i select any value, automatically, dependent values will appear for the next text box.

    Errors:

    1. As per the given code - Compile error: "Duplicate Declaration in the current scope" is coming

    2. If i remove the underlined code : Dim ws As Worksheet" Runtime Error 9: Subscript out of range is coming.

    Kindly guide me, how to fix the issue.

    Regards


    Please Login or Register  to view this content.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Duplicate Declaration in the Current Scope error

    In this,

    Please Login or Register  to view this content.
    VBA requires straight quotes.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Contributor
    Join Date
    08-19-2016
    Location
    Chennai, India
    MS-Off Ver
    2007
    Posts
    300

    Re: Duplicate Declaration in the Current Scope error

    Dear shg,

    Thanks for your reply. Since i am new to vba, i am learning through online only. I unable to understand your inputs. Could you please modify the code and teach me. Then i can relate my mistakes here.

    Regards

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Duplicate Declaration in the Current Scope error

    Do you see the difference in these two lines?

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    08-19-2016
    Location
    Chennai, India
    MS-Off Ver
    2007
    Posts
    300
    Yes, "" is the difference
    Last edited by jeffreybrown; 05-25-2018 at 04:12 PM. Reason: Removed full quote!

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Duplicate Declaration in the Current Scope error

    Right. VBA requires the second.

+ 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. Duplicate Declaration in current scope
    By Graham Griggs in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-06-2016, 11:40 AM
  2. Replies: 3
    Last Post: 04-24-2014, 10:28 AM
  3. [SOLVED] Duplication Declaration in Current scope
    By wonderd in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-08-2013, 06:56 AM
  4. [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
  5. Duplicate Declaration in Current Scope
    By TonyforVBA in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-23-2011, 08:27 AM
  6. Duplicate Decleration In Current Scope Error
    By Bono1083 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 06-27-2010, 09:28 PM
  7. 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