Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Clear Empty Strings

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

Thank you.



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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.





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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.




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Empty strings appear as zeros Paul Martin[_2_] Charts and Charting in Excel 5 May 9th 08 12:37 AM
clear all zero-length strings from spreadsheet? Matt D Francis Excel Discussion (Misc queries) 7 February 21st 07 05:33 PM
clear all zero-length strings from spreadsheet? Matt D Francis Excel Discussion (Misc queries) 0 February 21st 07 03:09 PM
clear all zero-length strings from spreadsheet? john Excel Discussion (Misc queries) 0 February 21st 07 02:58 PM
How can I convert empty strings to empty cells? Shane Excel Discussion (Misc queries) 2 July 19th 05 12:10 PM


All times are GMT +1. The time now is 10:18 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"