Deleting data

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?
 
G

Gord Dibben

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
 

Ask a Question

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. After that, you can post your question and our members will help you out.

Ask a Question

Top