View Single Post
  #6   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


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 the Excel worksheet:

1. ALT-F8
2. Select the macro
3. Touch RUN

To learn more about macros in general, see:

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




--
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 -