Re: Clearing cells that only contain spaces
From: Tom Ogilvy (twogilvy_at_msn.com)
Date: 02/24/04
- Next message: Amit: "Re: merge cells in Excel??"
- Previous message: Tom Ogilvy: "Re: quotation marks before and after each input"
- In reply to: Rodrigo Ayres: "Clearing cells that only contain spaces"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 24 Feb 2004 16:44:32 -0500
Dim rng as Range, cell as Range
On Error Resume Next
set rng = Active***.UsedRange.SpecialCells(xlconstants,xlTextValues)
On Error goto 0
for each cell in rng
if len(trim(cell.Value)) = 0 then
cell.Clearcontents
end if
Next
-- Regards, Tom Ogilvy "Rodrigo Ayres" <rodrigo.ayres@gov.ab.ca> wrote in message news:F1838A8C-5C79-449F-B43B-FDAC5F0AA08A@microsoft.com... > > Hi all! > > Can anyone tell me how to write code to remove any number of spaces from cells that ONLY contain spaces? > > Thank you! > > Rodrigo
- Next message: Amit: "Re: merge cells in Excel??"
- Previous message: Tom Ogilvy: "Re: quotation marks before and after each input"
- In reply to: Rodrigo Ayres: "Clearing cells that only contain spaces"
- Messages sorted by: [ date ] [ thread ]