Results 1 to 9 of 9

Disabling Option to Delete using VB Code

Threaded View

  1. #1
    Registered User
    Join Date
    10-14-2009
    Location
    Manila, Philippines
    MS-Off Ver
    Excel 2003
    Posts
    43

    Disabling Option to Delete using VB Code

    I have three columns in an excel sheet.

    A B C
    Date Logged HRID Name

    This excel sheet has a timestamping VB code applied. (see below) How do I customize it in a way that details under column A will not be deleted manually? I tried password protect but I seem to get VB Code debug issues whenever I activate it.

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Count > 1 Then Exit Sub
    Select Case Target.Column
    Case 2 To 3
    If Not IsDate(Cells(Target.Row, "a").Value) Then
    Application.EnableEvents = False
    Cells(Target.Row, "a").Value = Now()
    End If
    If IsEmpty(Target) Then Target.Offset(0, -1).ClearContents
    End Select
    Application.EnableEvents = True
    End Sub
    Thank you.
    Attached Files Attached Files
    Last edited by ltmaiyk; 04-20-2010 at 09:52 AM.

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