+ Reply to Thread
Results 1 to 2 of 2

How to prevent deleting certain rows

  1. #1
    Dory en Ed
    Guest

    How to prevent deleting certain rows

    Hello experts,


    I want to avoid that my users delete certain rows, because they contain
    hidden information.
    When they delete these rows the functionality will be disturbed.

    They are allowed to make others changes in the cells of these rows, just not
    to delete the whole row.

    I try to find a way to detect this with VBA code and then show a message.
    Did some examinations on the Worksheet.Change event, but still have no clue.
    It would be good already if it was possible to detect that one or several of
    the "forbidden" rows are selected (as whole rows) before deleting them.

    Hope you can help, it is very important for me.


    Thanks in advance,

    Ed van Wijngaarden



  2. #2
    Jim Cone
    Guest

    Re: How to prevent deleting certain rows

    Ed,

    You could place your hidden information on another
    sheet and hide that sheet.
    or
    Place some data in the specific rows and then
    check to see if it is still there after any change...
    '--------------------------------------------------------
    'Code goes in the worksheet code module.
    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim dblAnswer As Double
    dblAnswer = WorksheetFunction.Sum(Range("D14:D17")) '1, 2, 3, 4
    If dblAnswer <> 10 Then
    MsgBox "Don't do that"
    Application.Undo
    End If
    End Sub
    '------------------------------------------------------

    Regards,
    Jim Cone
    San Francisco, USA


    "Dory en Ed" <gentiana@planet.nl> wrote in message
    news:42c6935e$0$1645$ba620dc5@nova.planet.nl...
    Hello experts,
    I want to avoid that my users delete certain rows, because they contain
    hidden information.
    When they delete these rows the functionality will be disturbed.
    They are allowed to make others changes in the cells of these rows, just not
    to delete the whole row.
    I try to find a way to detect this with VBA code and then show a message.
    Did some examinations on the Worksheet.Change event, but still have no clue.
    It would be good already if it was possible to detect that one or several of
    the "forbidden" rows are selected (as whole rows) before deleting them.
    Hope you can help, it is very important for me.
    Thanks in advance,
    Ed van Wijngaarden



+ 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