+ Reply to Thread
Results 1 to 5 of 5

VBA code to run macro into protected worksheet

  1. #1
    Registered User
    Join Date
    04-28-2017
    Location
    SA
    MS-Off Ver
    2010
    Posts
    3

    VBA code to run macro into protected worksheet

    Please see below code I am using, which I pulled together from existing code, I need assistance in writing code to enable these macros to run into a protected sheet and then re-protect the sheet after running the macro?

    I have tried a couple of combinations I came across on the web, but have been unable to get them to work properly. Any assistance would be appreciated.

    Option Explicit

    Please Login or Register  to view this content.
    Last edited by Matthew1234; 05-02-2017 at 03:01 AM.

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: VBA code to run macro into protected worksheet

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

    Posting code between [CODE] [/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Click on Edit to open your thread, then 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)
    Last edited by Arkadi; 04-28-2017 at 10:47 AM.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  3. #3
    Registered User
    Join Date
    04-28-2017
    Location
    SA
    MS-Off Ver
    2010
    Posts
    3

    Re: VBA code to run macro into protected worksheet

    Amended Post, apologies for the incorrect posting.

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: VBA code to run macro into protected worksheet

    Hi matthew1234

    Try this; And the same for historywks...Use the code before and after
    Please Login or Register  to view this content.
    or

    Please Login or Register  to view this content.
    Last edited by sintek; 05-02-2017 at 04:20 AM.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  5. #5
    Registered User
    Join Date
    04-28-2017
    Location
    SA
    MS-Off Ver
    2010
    Posts
    3

    Re: VBA code to run macro into protected worksheet

    Thank you so much Sintek, please could you show me where to place your suggested code in my code? , thank you. I am inexperienced at coding and would appreciate the further help.

+ 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. [SOLVED] VBA code is not wroking in Protected worksheet
    By rajeshn_in in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-16-2016, 11:57 PM
  2. [SOLVED] VBA code to allow grouping/ungrouping in protected excel worksheet
    By SherryAnneMay in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-22-2015, 04:58 AM
  3. Excel Vba Code To enable protected worksheet
    By hetal_upadhyay in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-19-2014, 09:25 AM
  4. macro code for protected and shared worksheet
    By afbillah in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-29-2013, 03:41 PM
  5. How to make macro enabled worksheet functional in protected worksheet?
    By promo786 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-10-2011, 03:24 PM
  6. VBA code wont run on protected worksheet?
    By Paul Thomson in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-24-2010, 08:32 AM
  7. Replies: 1
    Last Post: 05-05-2010, 02:27 PM

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