+ Reply to Thread
Results 1 to 4 of 4

How to connect these two codes into one code.

  1. #1
    Registered User
    Join Date
    06-26-2011
    Location
    Kuopio
    MS-Off Ver
    Excel 2007
    Posts
    18

    How to connect these two codes into one code.

    Here's the thing;

    One sheet is called "Default", and it has data validation lists, textboxes, comboboxes etc, we don't change anything on this sheet.

    Then I use this code to add new sheet;

    Please Login or Register  to view this content.
    And when this new sheet appears, named after specific date, everything's restored, ok?? I can do changes, write text etc everything I want, and when I select "add new sheet", it gives me an new "fresh" sheet, named after specific date and it looks like "default-sheet".

    But what I still need, is that user CANNOT/IS UNABLE TO add more than ONE sheet.

    Like this;

    Today is 7.21.2011, I select "add new sheet", it gives me an error and messagebox that says "you can add new sheet tomorrow".

    When I'm using code ABOVE, it adds more and more sheets everytime I press "add new sheet", but in code BELOW, it gives me a message and I'm not allowed to add more sheets until next day.

    Please Login or Register  to view this content.

    So could you tell me how to connect these two codes.

    And also, how do I protect this "default-sheet" with macro-code so that no one can't change values etc. I've tried to hidden it, but then macros don't work. It does add a new sheet, but it comes a hidden sheet and is named like "Default(2)" or something.
    Last edited by Zahhhaaaa; 07-25-2011 at 07:13 AM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: How to connect these two codes into one code.

    I think this
    Please Login or Register  to view this content.
    Note: group your variable declarations at the top of the code for simplicity
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    06-26-2011
    Location
    Kuopio
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: How to connect these two codes into one code.

    It works, but it adds another sheet too called "Default(2)"

    And also, when I select "add new sheet", thing is that User isn't allowed to add more sheets than one per day. It still gives adds sheet, they're all named "Default".

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,334

    Re: How to connect these two codes into one code.

    Your post does not comply with Rule 8 of our Forum RULES. Cross-posting is when you post the same question in other forums on the web. You'll find people are disinclined to respond to cross-posts because they may be wasting their time solving a problem that has been solved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser)to the cross-post. Expect cross-posts without a link to be closed a message will be posted by the moderator explaining why. We are here to help so help us help you!

    Read this to understand why we ask you to do this, and then please add links to any and all cross-posts in other forums to your first post here.
    Everyone who confuses correlation and causation ends up dead.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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