Delete data in a single cell

ndfightingirish1971

New Member
Joined
May 14, 2013
Messages
6
I have what should be a simple problem but I have been racking my brain trying to figure out what I am doing wrong. I collect data using a wireless device that sends a signal to the PC and thus into Excel. Once the number is populated into a cell, it automatically moves to the next cell to the right (in my case, I have the move direction set to right). If the operator makes a mistake collecting the data, I created a button to allow them to go back one cell, delete the data, and retake the data. The problem with my code is that it does not delete the data. Can anyone please help me? Thanks!

Code:
Sub RETAKE_POINT()
SendKeys "+{Tab}"
Selection.ClearContents
End Sub
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Thanks ranman256... I tried that and a couple other things and nothing seems to work. I modified the code to read:

SendKeys "+{Tab}"
ActiveCell.Select
Selection.ClearContents

-and-

SendKeys "+{Tab}"
ActiveCell.Value = ""


Obviously, I am an amateur in most VBA coding but this should be pretty straight forward. I thought my Excel file might be corrupt so I tried the different versions of the code on a different PC with a brand new Excel file and got the same results. It's strange because the sendkeys portion works perfectly but once it moves to the previous cell, the previous (incorrect) data will not go away. Thanks again!
 
Upvote 0

Forum statistics

Threads
1,215,473
Messages
6,125,017
Members
449,203
Latest member
tungnmqn90

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top