ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro to clear cells of no value (https://www.excelbanter.com/excel-programming/379329-re-macro-clear-cells-no-value.html)

Bob Phillips

Macro to clear cells of no value
 
Dim cell As Range
For Each cell In Selection
cell.Value = Trim(cell.Value)
Next cell


--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"justme" wrote in message
...
Hi,

I need a macro to find cells where the whole cell contains only a
space/spaces, and/or punctuation and replace with nothing.
I need to leave ditto marks (") alone, however, because I do have to deal
with those in another way.

Basically, a macro to set cell value to null if it does not contain any
capital or lower case alpha characters or numbers.

It won't let me use "Not Like "*[A-Z]*"...etc." ?

Thank you!






justme

Macro to clear cells of no value
 
LOL Can't believe it was just TRIM!

Thanks so very much, Bob.!
:):):):):):):)


All times are GMT +1. The time now is 03:12 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com