+ Reply to Thread
Results 1 to 3 of 3

Declaring Strings

  1. #1
    Registered User
    Join Date
    06-18-2015
    Location
    UK
    MS-Off Ver
    2016
    Posts
    6

    Declaring Strings

    Hi All

    I'm fairly new to VBA, but have written some code so that when a checkbox is ticked an inputbox appears, forces a user to enter data, then that input data goes into a specific cell. everything worked fine on my first one. when I try to duplicate the same thing for a different checkbox, a different inputbox and different specific cell I get an error that says
    Compile error: Duplicate declaration in current scope.

    This is my code for the one that works;

    Please Login or Register  to view this content.
    [/I]and this is the code for the one that doesn't;

    Please Login or Register  to view this content.
    Please help....many thanks
    Last edited by babb101; 08-17-2016 at 03:01 AM.

  2. #2
    Valued Forum Contributor Neil_'s Avatar
    Join Date
    04-19-2013
    Location
    Yorkshire
    MS-Off Ver
    Office 365 Enterprise E3 2013 / 2016
    Posts
    479

    Re: Declaring Strings

    WallFinish is the name of an object already declared, a checkbox or something. I can tell because it has a _Click event which you are coding into. Use a different variable name, sWallFinish or strWallFinish.



    Duplicates:-
    Please Login or Register  to view this content.
    Last edited by Neil_; 08-16-2016 at 11:44 AM.
    Frob first, tweak later

  3. #3
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,613

    Re: Declaring Strings

    babb101,
    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Ben Van Johnson

+ 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. Macro to Delete only Alpha Strings but not Alphanumeric or Numeric Strings in a Cell
    By papageorgio in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-19-2016, 06:55 AM
  2. [SOLVED] Declaring and Initializing an Array of Strings
    By Akki4228 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-30-2013, 06:11 PM
  3. [SOLVED] Loop through strings stop when strings change and start looping in the next column...?
    By Prexcel in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-18-2013, 03:31 AM
  4. Replies: 1
    Last Post: 08-13-2013, 08:32 AM
  5. Replies: 2
    Last Post: 03-07-2013, 02:34 AM
  6. Replies: 9
    Last Post: 12-21-2012, 04:18 AM
  7. Replies: 5
    Last Post: 02-15-2012, 09:57 AM

Tags for this Thread

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