Results 1 to 7 of 7

Modify Auto Clear - VB Code

Threaded View

  1. #1
    Forum Contributor
    Join Date
    08-22-2005
    MS-Off Ver
    Office 365
    Posts
    342

    Modify Auto Clear - VB Code

    Hello,

    I have the following code which I am attempting to recycle into another workbook

    Private Sub Worksheet_Change(ByVal Target As Range)
    ' If target is not within D3:D350 then quit
    If Intersect(Target, Range("D3:D350")) Is Nothing Then Exit Sub
    ' Disable event handling while THIS macro is changing the sheet
    Application.EnableEvents = False
    ' if the target cell has just been cleared then clear the entire row
    ' otherwise put the date in column "H"
    Select Case Target.Value
    Case Is = Empty
    Range(Cells(Target.Row, "H"), Cells(Target.Row, "G")).ClearContents
    Case Is <> Empty
    Target.Offset(0, 4).Value = Date
    End Select
    ' re-enable event handling and quit
    Application.EnableEvents = True
    I need to modify this a bit and I am coming up short ...

    First .. when a number is entered into D3:D350 the current date will prefill on H3:H350
    And as per above if the number in D3:D350 is deleted it then auto clears H & G ... However I would like to clear the entire row.

    So if I Delete the number in D3:D350 I would like all data in A, C, E, F, G & H to autoclear.
    Last edited by SVTF; 07-01-2012 at 11:32 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