View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Arno Arno is offline
external usenet poster
 
Posts: 60
Default How to write a Clearcontents command in a macro

Hi, I tried the following but I get a sintax error

Worksheets("Sheet1").Range("U1:AA5000").Cell.Value ="".ClearContents

Can you help ?

"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.
I have been told that probably since I 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

My question is: how can I write the instruction above in the macro to make
it work?


Thank you for your help ! Arno