+ Reply to Thread
Results 1 to 6 of 6

Macro to Lock File if Terms are not Accepted

  1. #1
    Registered User
    Join Date
    04-26-2013
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    33

    Macro to Lock File if Terms are not Accepted

    I'm working on an excel document and I'd like to have a button macro on the first tab when opening to basically work like a "terms of service" agreement where if you press button a - agree it unlocks the other tabs and you can use the document but if you press button b - disagree the document stays locked.

    I was wondering if someone can help me with this pls?

    Thanks!

  2. #2
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Macro to Lock File if Terms are not Accepted

    Hi,

    Something like this what you're after?

    Hope this helps

  3. #3
    Registered User
    Join Date
    04-26-2013
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    33

    Re: Macro to Lock File if Terms are not Accepted

    Yes it looks like it! The buttons are not working for me though but I can see that you've hidden Sheet 1 and 2.

    So if I were to copy the VBA from this, what would I have to change in the VBA script to hide all 8 of my tabs?

    Thanks for your help!

  4. #4
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Macro to Lock File if Terms are not Accepted

    Perhaps the buttons aren't working because macros might be disabled???

    I tried to engineer it so that you wouldn't have to change anything except the 2 instances of "Sheet1" just change to the name of your worksheet with the 2 buttons on it. That should work without a hitch.

    Let me know

  5. #5
    Registered User
    Join Date
    04-26-2013
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    33

    Re: Macro to Lock File if Terms are not Accepted

    would it matter if im using a mac version of excel? ya i made sure i enabled the macros. Thanks for all your help

    So i would just replace "sheet1" w my first tab title, right?

    Private Sub Workbook_Open()
    Dim WS As Worksheet
    For Each WS In Me.Worksheets
    If WS.Name <> "Sheet1" Then
    WS.Visible = xlSheetVeryHidden
    End If
    Next WS
    End Sub

  6. #6
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Macro to Lock File if Terms are not Accepted

    It might, but I couldn't answer that question honestly as I've never used Excel for Mac sorry.

    Yeah that should do the trick

    There's also another section you should change in the "Sheet1" module

+ 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] Macro to search web page for multiple terms?
    By nihil95 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-29-2013, 12:54 AM
  2. need help with macro to calculate the difference from declined and accepted overtime
    By mmccra2858 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-21-2013, 09:42 AM
  3. Replies: 9
    Last Post: 11-03-2010, 11:42 AM
  4. SaveAs File Name Macro - change date field to accepted format
    By lisa_jd in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-03-2010, 08:46 AM
  5. excel cannot accepted the password and finily cannot open file
    By kumar in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-16-2006, 03:45 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