Results 1 to 9 of 9

Macro to delete entry in Sheet 2

Threaded View

  1. #1
    Forum Contributor
    Join Date
    07-28-2012
    Location
    madrid
    MS-Off Ver
    Excel 2010 at work excel 2016
    Posts
    1,102

    Macro to delete entry in Sheet 2

    Hi. I have this nearly finish project. I can make an entry i can search and find entries.
    The only thing i miss, is to be able to delete a entry.
    My calendar is in sheet2, which is protected with code 1111.
    I can from sheet1 make an entry in the calendar.
    I can also from sheet 1 search for a name, and it will come up and show all the entries in
    sheet3.
    What i finally miss is to be able to delete an entry. I imagine that when i have searched the name and i see the entries in Sheet3. i select the cells to delete and press a button
    in sheet 3 to delete this entry in sheet 2.
    It should be possible. In sheet 3 i have all dates upon the entries and its the same in sheet 2.

    Sheet 2 is runned by a Private Sub Worksheet_Change code. Its to put color on the entries.
    Its also code protected with code 1111.
    When i want to delete the entry i guess the code should be inside this. It disable the Worksheet_Change even and also take the protection away.
    After it take all back to normal.

    Please have a look at below testsheet. Hope some can help with this final thing.

    Sincerely
    Abjac

    Code to put new code inside.

    Sub disableworksheetchange()
        On Error GoTo ErrorHandler
         Application.EnableEvents = False
    Sheets(2).Activate
        Sheets(2).Unprotect Password:="1111"
    
    'Code to delete entry have to be in here, Application.EnableEvents = False
    ' disable the Private Sub Worksheet_Change in sheet 2 and enable it again after
    
    
    
    ErrorHandler:
        Application.EnableEvents = True
        Call setpass1
    End Sub
    Attached Files Attached Files

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