Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default Problems to delete blank/empty cells

Hello,

I copied data from an excel worksheet; all this data contains IF formulas.

Then in another column I paste special, as value, and I select the area in
order to delete the blank cells (Go to Special, blank, delete)

Unfortunately the application always says: "no cells found" and I cannot
delete the empty cells in the selection.
Probably I am pasting a string and Not an empty cell.

But I do not know how to solve this.

Thank you for your help ! Arno



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Problems to delete blank/empty cells

Edit Goto Special Blanks
will only select truly empty cells. It will not select cells with a formula
returning blanks or any paste of these cells.
--
Gary''s Student - gsnu200802


"Arno" wrote:

Hello,

I copied data from an excel worksheet; all this data contains IF formulas.

Then in another column I paste special, as value, and I select the area in
order to delete the blank cells (Go to Special, blank, delete)

Unfortunately the application always says: "no cells found" and I cannot
delete the empty cells in the selection.
Probably I am pasting a string and Not an empty cell.

But I do not know how to solve this.

Thank you for your help ! Arno



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Problems to delete blank/empty cells

You could do a For ... Each loop and check for cell.Value = "" then delete.

"Arno" wrote:

Hello,

I copied data from an excel worksheet; all this data contains IF formulas.

Then in another column I paste special, as value, and I select the area in
order to delete the blank cells (Go to Special, blank, delete)

Unfortunately the application always says: "no cells found" and I cannot
delete the empty cells in the selection.
Probably I am pasting a string and Not an empty cell.

But I do not know how to solve this.

Thank you for your help ! Arno



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 119
Default Problems to delete blank/empty cells

I agree with JLGWhiz. Since you have IF functions which may return a blank
value ("") if a condition is/isn't met, the better route for deleting would
be:
For ... Each loop check for Cell.Value="" then ClearContents
Using ClearContents preserves formatting of cells and clears the contents of
the cell (the IF formulas in your case) that returns a "" value.
--
Please rate posts so we know when we have answered your questions. Thanks.


"JLGWhiz" wrote:

You could do a For ... Each loop and check for cell.Value = "" then delete.

"Arno" wrote:

Hello,

I copied data from an excel worksheet; all this data contains IF formulas.

Then in another column I paste special, as value, and I select the area in
order to delete the blank cells (Go to Special, blank, delete)

Unfortunately the application always says: "no cells found" and I cannot
delete the empty cells in the selection.
Probably I am pasting a string and Not an empty cell.

But I do not know how to solve this.

Thank you for your help ! Arno



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default Problems to delete blank/empty cells

Hi,
thanks for your reply but how do I exactly erite in the macro:For.. Each
loop check for Cell.Value="" then ClearContents ?


"Orion Cochrane" wrote:

I agree with JLGWhiz. Since you have IF functions which may return a blank
value ("") if a condition is/isn't met, the better route for deleting would
be:
For ... Each loop check for Cell.Value="" then ClearContents
Using ClearContents preserves formatting of cells and clears the contents of
the cell (the IF formulas in your case) that returns a "" value.
--
Please rate posts so we know when we have answered your questions. Thanks.


"JLGWhiz" wrote:

You could do a For ... Each loop and check for cell.Value = "" then delete.

"Arno" wrote:

Hello,

I copied data from an excel worksheet; all this data contains IF formulas.

Then in another column I paste special, as value, and I select the area in
order to delete the blank cells (Go to Special, blank, delete)

Unfortunately the application always says: "no cells found" and I cannot
delete the empty cells in the selection.
Probably I am pasting a string and Not an empty cell.

But I do not know how to solve this.

Thank you for your help ! Arno





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Problems to delete blank/empty cells

Here is some code:

Sub clear_blank()
For Each r In Selection
If r.Value = "" Then
r.ClearContents
End If
Next
End Sub


Macros are very easy to install and use:

1. ALT-F11 brings up the VBE window
2. ALT-I
ALT-M opens a fresh module
3. paste the stuff in and close the VBE window

If you save the workbook, the macro will be saved with it.

To remove the macro:

1. bring up the VBE window as above
2. clear the code out
3. close the VBE window

To use the macro from Excel:

1. Select the cells to be €ścleaned€ť
2. ALT-F8
3. Select the macro
4. Touch RUN

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

--
Gary''s Student - gsnu200802


"Arno" wrote:

Hi,
thanks for your reply but how do I exactly erite in the macro:For.. Each
loop check for Cell.Value="" then ClearContents ?


"Orion Cochrane" wrote:

I agree with JLGWhiz. Since you have IF functions which may return a blank
value ("") if a condition is/isn't met, the better route for deleting would
be:
For ... Each loop check for Cell.Value="" then ClearContents
Using ClearContents preserves formatting of cells and clears the contents of
the cell (the IF formulas in your case) that returns a "" value.
--
Please rate posts so we know when we have answered your questions. Thanks.


"JLGWhiz" wrote:

You could do a For ... Each loop and check for cell.Value = "" then delete.

"Arno" wrote:

Hello,

I copied data from an excel worksheet; all this data contains IF formulas.

Then in another column I paste special, as value, and I select the area in
order to delete the blank cells (Go to Special, blank, delete)

Unfortunately the application always says: "no cells found" and I cannot
delete the empty cells in the selection.
Probably I am pasting a string and Not an empty cell.

But I do not know how to solve this.

Thank you for your help ! Arno



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
delete row if 2 cells are empty Wanna Learn Excel Discussion (Misc queries) 1 November 19th 09 10:20 PM
Need blank cells to remain empty Bebe Excel Worksheet Functions 7 March 25th 09 02:23 AM
delete cells column. Delete empty cells myshak Excel Worksheet Functions 0 March 9th 09 10:59 PM
Delete Rows with Empty Cells with empty column 1 Scott Excel Programming 5 October 2nd 06 11:57 PM
Can blank cells created using empty Double-Quotes not be empty?? JohnI in Brisbane Excel Programming 6 September 7th 03 11:22 PM


All times are GMT +1. The time now is 02:18 PM.

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

About Us

"It's about Microsoft Excel"