ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Clear Empty Strings (https://www.excelbanter.com/excel-programming/278817-clear-empty-strings.html)

Tim Tabor

Clear Empty Strings
 
What is the most efficient way to empty all cells with empty string values?

Thank you.




Tom Ogilvy

Clear Empty Strings
 
select the cells, then do
Edit=Clear and select contents or all

--
Regards,
Tom Ogilvy


Tim Tabor wrote in message
...
What is the most efficient way to empty all cells with empty string

values?

Thank you.






Tim Tabor

Clear Empty Strings
 
"Tom Ogilvy" wrote in message
...
select the cells, then do
Edit=Clear and select contents or all


Thanks Tom. Couple of things. First, I'm looking for a programmatic
solution. And second, I'm only looking to clear cells whose contents are
empty strings.



Tom Ogilvy

Clear Empty Strings
 
Dim rng as Range
Dim cell as Range
On Error Resume Next
set rng = Cells.SpecialCells(xlConstants,xlTextValues)
On Error goto 0
if not rng is nothing then
for each cell in rng
if cell.Value = "" then
cell.ClearContents
end if
Next
End if
set rng = Nothing
On Error Resume Next
set rng = Cells.specialCells(xlformulas,xlTextValues)
On Error goto 0
if not rng is nothing then
for each cell in rng
if cell.value = "" thenh
cell.ClearContents
end if
Next
End if

--
Regards,
Tom Ogilvy


Tim Tabor wrote in message
...
"Tom Ogilvy" wrote in message
...
select the cells, then do
Edit=Clear and select contents or all


Thanks Tom. Couple of things. First, I'm looking for a programmatic
solution. And second, I'm only looking to clear cells whose contents are
empty strings.






All times are GMT +1. The time now is 05:01 AM.

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