Replacing cells that have 2-3 letters

  • Thread starter Thread starter drewd
  • Start date Start date
D

drewd

I'am have been unable to find a way to replace cells that have 2-
letters only.
I would greatly apperciate any help.

Thanks in advance
Dre
 
Dim cell as Range
for each cell in
ActiveSheet.UsedRange.specialcells(xlconstants,xlTextValues)
if len(cell.Value) = 2 or len(cell.Value) = 3 then
cell.clearcontents
end if
Next

Not sure what you want to replace them with - in the above, the cell is
cleared.
 
What do you want to replace with? Do you mean clear these cells? Are there
cells that have numbers with only 2 or 3 digits, or is the column all text?
 
Back
Top