+ Reply to Thread
Results 1 to 3 of 3

Can't get two macros to run from a single command button on a protected worksheet

  1. #1
    Registered User
    Join Date
    12-12-2012
    Location
    Orlando, FL
    MS-Off Ver
    Excel 2010
    Posts
    40

    Can't get two macros to run from a single command button on a protected worksheet

    I have a protected worksheet with data entry rows of A1:P126 that are only printed if they contain data per the first macro below. I am trying to get this to be run within the Email_sheet code below but can't seem to figure it out.

    Was hoping someone could help me out on how to combine these to run from a single command button.

    Thanks in advance

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  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: Can't get two macros to run from a single command button on a protected worksheet

    Just add this to somewhere in the Email_Sheet code (where it is unprotected).
    Please Login or Register  to view this content.
    As the sheet is protected, you could set the UserInterface property to true to allow macros to run. Do this by protecting your sheet in the immediate window of the VB Editor rather than the ribbon.

    Please Login or Register  to view this content.
    Frob first, tweak later

  3. #3
    Valued Forum Contributor meabrams's Avatar
    Join Date
    10-03-2014
    Location
    USA
    MS-Off Ver
    2007, 2010, 2013, 2016
    Posts
    451

    Re: Can't get two macros to run from a single command button on a protected worksheet

    If both macro are function as designed then just place a call for the other macro in the macro you want to run first.
    So for instance if you want it to run after PrintMarkedRows then Place a call at the end of the macro before the End Sub that looks like Call Email_Sheet…

    It should look something like this


    Please Login or Register  to view this content.

+ 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] Colour single row by a command button
    By Gaz3394 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-03-2013, 11:13 AM
  2. [SOLVED] Runtime Error using Command Button when Worksheet is Protected
    By HangMan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-08-2012, 09:17 AM
  3. 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
  4. Single use macro in command button
    By JamesT1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-15-2010, 03:21 PM
  5. Hide command button if worksheet is protected
    By PRodgers4284 in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 10-05-2009, 07:32 AM
  6. Creating Command Button macros
    By MSE in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-28-2008, 11:36 PM
  7. Two Macros under One command button
    By Rony in forum Excel General
    Replies: 1
    Last Post: 03-11-2006, 08:15 AM
  8. Replies: 0
    Last Post: 09-21-2005, 04:05 AM

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