Results 1 to 2 of 2

Macros code to erase data

Threaded View

  1. #1
    Registered User
    Join Date
    01-08-2012
    Location
    Brisbane
    MS-Off Ver
    Excel 2007
    Posts
    19

    Macros code to erase data

    Grettings people

    just need someone to help me with completing my macros code. I am trying to get a cell to display a code when i enter a number into another cell. I have most of the code but i am looking to add in another line that enables me to delete all data in the output cell when the input cell is blank.
    here is what i have so far

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
      If Not Intersect([D7,Target) Is Nothing Then
         Application.EnableEvents = False
         Cells(Target.Row, 2) = Now
         Application.EnableEvents = True
      End If
    End Sub

    As i mentioned earlier, once the input cell is blank it should erase all data in the output cel.
    Sorry guys, I know this seems easy but i am having a really bad mental block today.

    appreciate the help
    cheers
    Last edited by Brainstorm; 01-10-2012 at 10:11 PM.

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