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

sadams1

Board Regular
Joined
Aug 19, 2006
Messages
216
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

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

Forum statistics

Threads
1,213,546
Messages
6,114,251
Members
448,556
Latest member
peterhess2002

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