+ Reply to Thread
Results 1 to 2 of 2

Can a woorksheet with VBA be made to expire, or stop working?

  1. #1
    Forum Contributor
    Join Date
    11-26-2008
    Location
    Ohio
    MS-Off Ver
    2016
    Posts
    326

    Can a woorksheet with VBA be made to expire, or stop working?

    I have some VBA code that puts symbols & words in a cell, based on the letter in the
    cell to the left, when it is clicked on. The code works fine.

    My question is: Is there a way to add code, (or do something else) to make my
    worksheets "expire / or stop working" on a certain date, or times opened?

    My code is below.

    Thanks in advance for any help.
    Richard


    [code]

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)

    Const WS_RANGE As String = "A1:BU1450" '<=== change to suit

    If Target.Count > 1 Then Exit Sub
    If Not Target.Offset(, -1).Value Like "[qwertyui]" Then Exit Sub

    Application.EnableEvents = False

    If Not Application.Intersect(Target, Range(WS_RANGE)) Is Nothing Then
    With Target
    Select Case .Offset(, -1).Value
    Case "q":
    .Font.Name = "arial"
    .Value = IIf(.Value = "x", "", "x")
    Case "w":
    .Font.Name = "Wingdings 2"
    .Value = IIf(.Value = "t", "", "t")
    Case "e":
    .Font.Name = "arial"
    .Value = IIf(.Value = "FE", "", "FE")
    Case "r":
    .Font.Name = "arial"
    .Value = IIf(.Value = "RN", "", "RN")
    Case "t":
    .Font.Name = "arial"
    .Value = IIf(.Value = "MN", "", "MN")
    Case "y":
    .Font.Name = "arial"
    .Value = IIf(.Value = "NI", "", "NI")
    Case "u":
    .Font.Name = "arial"
    Select Case .Value
    Case "Yes": .Value = "No"
    Case "No": .Value = "Maybe"
    Case "Maybe": .Value = "Never"
    Case "Never": .Value = ""
    Case "": .Value = "Yes"
    End Select
    Case "i":
    .Font.Name = "arial"
    Select Case .Value
    Case "One": .Value = "Two"
    Case "Two": .Value = "Three"
    Case "Three": .Value = ""
    Case "": .Value = "One"
    End Select
    End Select
    .Offset(0, -1).Activate
    End With
    End If

    Application.EnableEvents = True

    End Sub

    [code]

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,936

    Re: Can a woorksheet with VBA be made to expire, or stop working?

    Welcome to the Forum, unfortunately:

    This is a duplicate post and as such does not comply with Rule 5 of our forum rules. This thread will now be closed, you may continue in your other thread.

    Thread Closed.
    Ben Van Johnson

+ 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] Made a simple template but not working
    By BNCOXUK in forum Excel General
    Replies: 3
    Last Post: 04-13-2013, 06:49 PM
  2. How to show only Working Day on expire date (Friday + 2 = Tuesday)
    By alexnkc in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-20-2013, 01:01 PM
  3. Replies: 0
    Last Post: 05-17-2005, 05:49 PM
  4. [SOLVED] Woorksheet locked on active cell
    By ESD in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-18-2005, 11:06 AM
  5. [SOLVED] RS232 to Excel woorksheet
    By Franz in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-21-2005, 03:06 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