+ Reply to Thread
Results 1 to 3 of 3

Two into one function again

  1. #1
    Registered User
    Join Date
    03-02-2008
    Posts
    8

    Two into one function again

    Hi,
    I need to made a auto open macro which will protect a sheet after a certain date. I have two bits of code:

    PHP Code: 
    Sub Auto_Open12()
    Dim i As Integer

    If Date <= DateSerial(200831Then
    Application
    .ScreenUpdating False
    For 2 To Worksheets.Count
    Worksheets
    (i).Visible True
    Next i
    Application
    .ScreenUpdating True
    Else
    Put some code in here????????
    End If
    End Sub 
    Which gives an activation date, and this:

    PHP Code: 
    Sub ProtectSheet()

    Sheets("Database Refresh").Select
    ActiveSheet
    .Protect Password:="1968javajon"

    End Sub 
    Which asks for a password to enter sheet after that date, so I was wondering how I can put the two functions together to act as one.

    Also I was wondering if any knows of a good reference book to learn VB I've learnt some Java, Javascript and html and would like to get a understanding.

  2. #2
    Forum Contributor
    Join Date
    11-17-2006
    Posts
    152
    try this. it will active when the workbook is opened and will password protect the sheets if the date is greater that March 1st 2008

    Please Login or Register  to view this content.
    i found the dummies VBA book good for learning VBA
    Last edited by jonn; 03-04-2008 at 06:20 PM.

  3. #3
    Registered User
    Join Date
    03-02-2008
    Posts
    8

    Thanks

    Hi,
    That's brill works a treat.
    Thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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