+ Reply to Thread
Results 1 to 8 of 8

VAB/Macro to unhide, unprotect, copy to other worksheets, protect & hide worksheets again

  1. #1
    Registered User
    Join Date
    01-02-2014
    Location
    Cape Town
    MS-Off Ver
    Excel 2007
    Posts
    88

    VAB/Macro to unhide, unprotect, copy to other worksheets, protect & hide worksheets again

    Good day, I kind of summarized my problem in the title but I am going to attached the workbook and also explain what I'm struggling to achieve
    we need to following to happen in this workbook

    1.Unhide worksheets 1 to 21
    2. Unprotect each worksheet -1 to 21 (password lss16)
    3. Copy from worksheet "Master worksheet plus macro"
    4. Copy to worksheets 1 to 21
    5. Protect worksheets 1 to 21 again and then hide ws 1 to 21

    Not sure what else to mention

    Many thanks
    Ralph
    Attached Files Attached Files

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: VAB/Macro to unhide, unprotect, copy to other worksheets, protect & hide worksheets ag

    LOL: You 'summarized title' has just created a new method VAB, new to me just making fun of you I make typing errors with every line I type.
    Your explanation is clear and I think any of us here can help.
    I don't know how your VBA knowledge is but if you read you explanation, you already have the solution.
    All VBA is, is a set of instructions that is carried out line by line.
    So just 'translate' what you want to code respecting the VBA syntax and you got it working.

    Unhide worksheets 1 to 21 (I hope the numbers are correct), remember that worksheets are numbered automatically so if you delete a worksheet and add a new one it may not get the same number as the one you just deleted.

    But, my assumption is that you want to have a clean file, so why not just delete the worksheets (except the Master Timesheet ) and the copy the Master Timesheet 21 times? and hide all?
    I'll see what your file looks like but please confirm if my assumption is correct or not
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: VAB/Macro to unhide, unprotect, copy to other worksheets, protect & hide worksheets ag

    BTW: there is no macro in the Master Template and Sheets 1 - 21 are not the same, so just copy is not the correct option.
    The top rows of the Mater sheet are different and all cells give a #REF error in the formula's
    Is this sample at least correct or is it missing things because it's a copy for the forum?

  4. #4
    Registered User
    Join Date
    01-02-2014
    Location
    Cape Town
    MS-Off Ver
    Excel 2007
    Posts
    88

    Re: VAB/Macro to unhide, unprotect, copy to other worksheets, protect & hide worksheets ag

    Hello Keebelah - lol
    okay to start with my VBA knowledge is poor - I normally record a "small" macro and pretend to be an expert:-) to answer your next question is the sample is a copy for the forum and I forgot to mention to we will only copy from row 7 to row 67 - what we are trying to do is when we make any changes to the many formulas in the grey columns we would like to copy that to all other ws instead of making 21 changes - yes the #REF is a result of deleting some hidden worksheets to get the sample to the required size
    I have a "solid macro for unhide multiple sheets, protect and unprotect multiple sheets problem is I don't know how to put it all together in one macro - also still need to figure out to hide multiple (selected by name) ws- hope this helps?

  5. #5
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: VAB/Macro to unhide, unprotect, copy to other worksheets, protect & hide worksheets ag

    I think it's clear.
    When you say modifying formulas that means that it can be so that there is already data present and does this mean that you want to keep it or just overwrite the cells with the blanks and (modified) formulas?
    So the macro you mention is that you want to do this with a macro?
    I'll see if I can help you, I've got some ideas but don't hold your breath, I'm a little busy right now but will get something together this afternoon, and since we're in the same time zone, it's your afternoon too

    Nothing wrong with recording macros and becoming an 'expert' , practice will make you that expert, just take your time, have patience an d more time, and more patience, imagination is the limit
    Last edited by Keebellah; 11-08-2018 at 04:32 AM. Reason: typeO

  6. #6
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: VAB/Macro to unhide, unprotect, copy to other worksheets, protect & hide worksheets ag

    One thing, if there is data in the other worksheets because you just wanted to update a formula, this can be done too.
    Just copy the formulas without overwriting the already present values that have been entered.

  7. #7
    Registered User
    Join Date
    01-02-2014
    Location
    Cape Town
    MS-Off Ver
    Excel 2007
    Posts
    88

    Re: VAB/Macro to unhide, unprotect, copy to other worksheets, protect & hide worksheets ag

    Perhaps I should not have mentioned formulas as it should be for all changes made in Master worksheet plus macro from row 7 to 67

  8. #8
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: VAB/Macro to unhide, unprotect, copy to other worksheets, protect & hide worksheets ag

    Okay, but can you explain, what is the "macro from row 7 to 67" there is in the worksheet, (As far as I can see) no macro in the sheet's VBA

+ 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. Replies: 1
    Last Post: 04-25-2017, 11:23 AM
  2. Macro to Hide Most Worksheets, Protect Workbook, Save a Copy
    By brendangroff in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-09-2016, 02:40 PM
  3. [SOLVED] Unprotect/Protect worksheets between start/end worksheets
    By thebutlerdidit in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-15-2015, 03:14 PM
  4. Macro to unprotect refresh protect along multiple worksheets
    By kfryar in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-04-2014, 09:40 PM
  5. Password protected command button to protect/unprotect and hide/unhide
    By cpercival in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-07-2011, 03:27 PM
  6. Re: Using Macro to protect and unprotect worksheets
    By simpson in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-09-2010, 02:11 AM
  7. Using Macro to protect and unprotect worksheets
    By jfoote in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-23-2008, 04:43 PM

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