+ Reply to Thread
Results 1 to 3 of 3

What would I need to change ?

  1. #1
    Forum Contributor
    Join Date
    04-15-2008
    Location
    Texas, USA
    MS-Off Ver
    M365 Excel Version 2210
    Posts
    198

    What would I need to change ?

    I have this macro that is working well but it runs upon opening the workbook. What would I need to change to get this to happen as the user closes the model instead of as it opens?

    Private Sub Workbook_Open()

    Application.ScreenUpdating = False

    'Turns Workbook to Auto Calc as it opens
    Application.Calculation = xlCalculationAutomatic
    Application.CalculateBeforeSave = True

    'Hide Administrator Calculation Rows
    On Error Resume Next
    Sheets("Input").Rows("8:199").EntireRow.Hidden = True
    Sheets("Input").Rows("532:1027").EntireRow.Hidden = True
    Sheets("Input").Rows("467:515").EntireRow.Hidden = True
    On Error GoTo 0

    'Protect each sheet as it opens
    Sheets("Results").Select
    Range("A1").Select
    ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True

    Sheets("Input").Select
    ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True

    Application.ScreenUpdating = True
    Range("A1").Select

    End Sub

    Thanks,
    RR

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: What would I need to change ?

    Change the first line to:=

    Please Login or Register  to view this content.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Forum Contributor
    Join Date
    04-15-2008
    Location
    Texas, USA
    MS-Off Ver
    M365 Excel Version 2210
    Posts
    198

    Re: What would I need to change ?

    PERFECT!

    Thanks,
    RR

+ 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. Need Help - Automatic website navigation page change based on column data change
    By cbatten01 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-10-2015, 08:00 PM
  2. [SOLVED] How to prevent worksheet change invoking System X Control change event
    By dmw2014 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 09-13-2014, 10:35 PM
  3. Replies: 5
    Last Post: 02-01-2013, 12:58 PM
  4. Replies: 15
    Last Post: 04-17-2012, 08:19 AM
  5. auto change cell formula on condition of worksheet change in other cells
    By futurejock in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-01-2009, 12:11 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