+ Reply to Thread
Results 1 to 6 of 6

AddSheet Calendar Macro Issue

  1. #1
    Registered User
    Join Date
    04-14-2009
    Location
    Queensland
    MS-Off Ver
    MSOffice 2003
    Posts
    11

    AddSheet Calendar Macro Issue

    Hello all,
    New member with limited vba experience.
    I searched a fair bit for a solution but found nothing to point me in the required direction.

    The issue: I have a macro to create a new wsheet with a tabname from a cell in a sheet called Data. The cell value (from Data), is a date which is inserted when a date is seleted from a popup calendar.This cell value then names the sheet tab and also appears in cell M1 in the sheet just created.
    Now, when I select another date from the calendar (to create a new sheet), the macro works perfectly-(it creates and name the new sheet tab with the new date and copy the new date to M1 in same sheet)...but, any sheets previously created will now change all values in cell M1 to the most recent selected date but all tabnames remain correct?
    Required outcome: is for any sheet previously created to have the cell M1 not linked to the calendar somehow...if that makes any sense


    thanks
    Attached Files Attached Files
    Last edited by VBA Noob; 04-15-2009 at 01:29 AM. Reason: Protect the guilty-changed names in attachment

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: AddSheet Calendar Macro Issue

    Hello nauti,

    Welcome to the Forum!

    Here is the revised macro which has been added to the attached workbook.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    04-14-2009
    Location
    Queensland
    MS-Off Ver
    MSOffice 2003
    Posts
    11

    Re: AddSheet Calendar Macro Issue

    Cheers heaps Ross!

    I was going thru the vba Objects help file to also try and tidy up the macro and stop the (shakes) when it executes ha! ha!..but I see now you only use these two lines
    Please Login or Register  to view this content.
    ...it's a big learning curve for me and am very thankful for the help you provided!

    cheers
    (rep added)

  4. #4
    Registered User
    Join Date
    04-14-2009
    Location
    Queensland
    MS-Off Ver
    MSOffice 2003
    Posts
    11

    Re: AddSheet Calendar Macro Issue

    Hello again Ross,

    I now have managed to protect my workbook's vba code with the following in the "Welcome" sheet:
    Please Login or Register  to view this content.
    ...but I can't seem to password-protect the newly created sheets (after details have been entered), I tried the above arrangement in the template sheet but no cigar!
    I would like these newly created sheets to be read only with passwordto modify.

    cheers

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: AddSheet Calendar Macro Issue

    Hello nauti,

    I changed the macro to protect the sheet after it has been added. You can set the password to what you like in the code.
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    04-14-2009
    Location
    Queensland
    MS-Off Ver
    MSOffice 2003
    Posts
    11

    Re: AddSheet Calendar Macro Issue

    Cheers Leith,

    Worked nicely.

+ 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