View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Easy Excel Question

You must insure that cell Z100 has a zero in it.
--
Gary''s Student - gsnu200725


"Dolphy" wrote:

Hi Gary,

I seem to be unable to use the below script. I'm using Office Xp
(Excel 2002).

I've copy and pasted the script using the below steps:

On the Tools menu in Microsoft Excel, point to Macro, and then click
Visual Basic Editor.
On the Insert menu, click Module.
Type or copy your code into the code window of the module.
If you want to run the macro (macro: An action or a set of actions you
can use to automate tasks. Macros are recorded in the Visual Basic for
Applications programming language.) from the module window, press F5.
When you're finished writing your macro, click Close and Return to
Microsoft Excel on the File menu.

What am I doing wrong?

Rgds,
Dolphy

On May 28, 10:26 am, Gary''s Student
wrote:
Consider Cell Z100:

Sub kill_row()
Set r = Range("Z100")
If Not IsEmpty(r) Then
If r.Value = 0 Then
r.EntireRow.Delete
End If
End If
End Sub

Note we check that the cell is not empty and has a real zero in it.
--
Gary''s Student - gsnu200725



"Dolphy" wrote:
Hi All,


I wanted to run a simple script/macro in Excel.


All I wanted is a rule whereby if a cell has a value of 0 (zero) I
would like to delete the row.


Can someone please assist?


TIA
Dolphy- Hide quoted text -


- Show quoted text -