is code available to do the equivalent of hitting the "delete" key...

sadams1

Board Regular
Joined
Aug 19, 2006
Messages
219
I have an array that is a mix of cells with printing & non printing characters. I'd like the cells that appear blank or empty to be returned to the equivalent of hitting the "delete" key. I've used the "clean", "trim" functions but the cells still seem to have something remaining. Manually hitting the delete key solves the problem but I'd like to see if code could be used to do the same.
 
last thing...promise! have noticed this runs very slowly as ranges with 1,000's of rows are selected. I break the routine by hitting "escape" & looking at the "debug"....instead of the code break being in the macro, it's breaking a completely different macro (!?) These are completely independent of each other so not sure what to make of this but my guess is that is has something to do with the sluggishness?
Attached is what I'm seeing when running your code (1st screenshot) then after breaking code (2nd screenshot)
 

Attachments

  • Untitledxxx.png
    Untitledxxx.png
    30.6 KB · Views: 3
  • x.png
    x.png
    21.3 KB · Views: 3
Upvote 0

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.

Forum statistics

Threads
1,215,151
Messages
6,123,321
Members
449,094
Latest member
Chestertim

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