Deleting data

  • Thread starter Thread starter chucksatt
  • Start date Start date
C

chucksatt

I want to enter data into a cell, move the cursor to another cell and
at the same time automatically delete the data that was entered. Is
there a function fro this?
 
Not without event code. See below.

Why would you want to perform this action?

Easiest would be to not enter anything in the cell to start with.

Private Sub Worksheet_Change(ByVal Target As Range)
Const myRange As String = "A1:A10"
On Error GoTo endit
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(myRange)) Is Nothing Then
If Target.Value <> "" Then
Target.ClearContents
End If
End If
endit:
Application.EnableEvents = True
End Sub


Gord Dibben MS Excel MVP
 
Back
Top