Deleting specific information

Discussion in 'Excel Programming' started by jan120253@gmail.com, May 14, 2014.

  1. Guest

    Hi Group

    I have created this code (its just a subset of e longer code) on the Worksheet_Change event:

    If Not Intersect(Target, Range("d4:d9")) Is Nothing Then
    Select Case Target.Value
    Case Is = 1
    Range("M13") = Target.Offset(0, -1)
    Case Is = 2
    Range("M20") = Target.Offset(0, -1)
    Case Is = 3
    Range("H9") = Target.Offset(0, -1)
    Case Is = 4
    Range("H17") = Target.Offset(0, -1)
    Case Is = 5
    Range("H25") = Target.Offset(0, -1)
    Case Is = 6
    Range("H33") = Target.Offset(0, -1)
    End Select
    End If

    It makes it possible to type numbers in D4:D9. Depending on what number is typed, the content of the corresponding row in column C is copied to a new destination. This Works perfectly all right. Now the guy will be using it, would like to add a delete function. If he deletes a number in one of the cells, D4 to D9, he wants the corresponding info in column M and H to be deleted as well.

    I can't see an easy way to do this, without storing whats already in the cell, before deletion. Like if the number 2 is deleted, then M20 has to be deleted too. But when the cell content is deleted, I won't know, what was in it before.

    Do anyone have an idea on how to accomplish this?

    Jan
     
    , May 14, 2014
    #1
    1. Advertisements

  2. Guest

    Addition:

    And if all the cells in D4:D9 are selected and deleted at once, of course all the relevant information in H and M must be deleted as well.

    Jan
     
    , May 14, 2014
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Similar Threads
  1. JHawaii

    Extracting Specific Information in Cells

    JHawaii, Sep 11, 2003, in forum: Excel Programming
    Replies:
    0
    Views:
    113
    JHawaii
    Sep 11, 2003
  2. rmaloy
    Replies:
    5
    Views:
    233
    rmaloy
    Feb 9, 2004
  3. ACTLibrarian
    Replies:
    1
    Views:
    131
    Glen Mettler
    Nov 13, 2004
  4. crs
    Replies:
    2
    Views:
    85
  5. ExcelMonkey

    Deleting Custom Views when Deleting Sheets

    ExcelMonkey, Mar 28, 2007, in forum: Excel Programming
    Replies:
    1
    Views:
    135
    NickHK
    Mar 28, 2007
  6. brownti via OfficeKB.com

    Replace information based on existing information

    brownti via OfficeKB.com, Jul 26, 2007, in forum: Excel Programming
    Replies:
    0
    Views:
    117
    brownti via OfficeKB.com
    Jul 26, 2007
  7. Keith

    Information dependent on other information

    Keith, Feb 6, 2008, in forum: Excel Programming
    Replies:
    0
    Views:
    83
    Keith
    Feb 6, 2008
  8. Greg
    Replies:
    2
    Views:
    175
Loading...