View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz JLGWhiz is offline
external usenet poster
 
Posts: 3,986
Default Creating a macro

Mike's code should do that.

"JC" wrote:

JLGWhiz,
Can we make this say that anywhere in Column AD there is a zero, delete that
corresponding row??

"JLGWhiz" wrote:

Press Alt + F11 to open the VB editor, If the window is dark, use
InsertModule and then paste the code below into the window. You can run the
code from Excel by clicking ToolsMacroMacrosRun. Make sure this macro is
in the top window of the dialogue box.

Sub delRws()
If Range("AD5") = 0 And Range("AD43") = 0 _
And Range("AD50") = 0 Then
Set delRng = Application.Union(Rows(5), Rows(43), Rows(50))
delRng.EntireRow.Delete
End If
End Sub

"JC" wrote:

Hey guys,
I need to create a macro and i've never done this...i think that this is a
simple macro to build, just need a little help...

I need to build a macro that will delete an entire row when a particular
column =zero....Example...

If cell AD5, AD43 and AD 50 equal zero, i want the macro to delete row 5, 43
and 50.

Thanks!!