#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Macro help


Can anyone help me write a macro that deletes the entire row if the cell
in the corresponding row in column AL = "0" ?

Thanks

Phil


--
phil2006
------------------------------------------------------------------------
phil2006's Profile: http://www.excelforum.com/member.php...o&userid=35092
View this thread: http://www.excelforum.com/showthread...hreadid=566272

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Macro help

Sub DeleteRows_With_Zero()
findstring = "0"
Set B = Columns(38).Find(What:=findstring, LookAt:=xlPart)
While Not (B Is Nothing)
B.EntireRow.Delete
Set B = Columns(38).Find(What:=findstring, LookAt:=xlPart)
Wend
End Sub


Gord Dibben MS Excel MVP

On Sat, 29 Jul 2006 09:16:35 -0400, phil2006
wrote:


Can anyone help me write a macro that deletes the entire row if the cell
in the corresponding row in column AL = "0" ?

Thanks

Phil


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Macro help


Thanks! This isn't working entirely tho. I want the row deleted if the
cell has the value "0". Alternatively if I could Fill the whole row
with a colour it would be equally as effective and possibly more
useful.

Thanks



Phil


--
phil2006
------------------------------------------------------------------------
phil2006's Profile: http://www.excelforum.com/member.php...o&userid=35092
View this thread: http://www.excelforum.com/showthread...hreadid=566272

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Macro help

I think xlPart should be replaced with xlWhole.

707 should be kept
0 should be deleted.



Gord Dibben wrote:

Sub DeleteRows_With_Zero()
findstring = "0"
Set B = Columns(38).Find(What:=findstring, LookAt:=xlPart)
While Not (B Is Nothing)
B.EntireRow.Delete
Set B = Columns(38).Find(What:=findstring, LookAt:=xlPart)
Wend
End Sub

Gord Dibben MS Excel MVP

On Sat, 29 Jul 2006 09:16:35 -0400, phil2006
wrote:


Can anyone help me write a macro that deletes the entire row if the cell
in the corresponding row in column AL = "0" ?

Thanks

Phil


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Macro help

Thanks Dave.

This is the second time I have posted this code without making the correction.

Will make the change and re-archive.


Gord

On Sat, 29 Jul 2006 11:07:10 -0500, Dave Peterson
wrote:

I think xlPart should be replaced with xlWhole.

707 should be kept
0 should be deleted.



Gord Dibben wrote:

Sub DeleteRows_With_Zero()
findstring = "0"
Set B = Columns(38).Find(What:=findstring, LookAt:=xlPart)
While Not (B Is Nothing)
B.EntireRow.Delete
Set B = Columns(38).Find(What:=findstring, LookAt:=xlPart)
Wend
End Sub

Gord Dibben MS Excel MVP

On Sat, 29 Jul 2006 09:16:35 -0400, phil2006
wrote:


Can anyone help me write a macro that deletes the entire row if the cell
in the corresponding row in column AL = "0" ?

Thanks

Phil


Gord Dibben MS Excel MVP
  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Macro help


Thanks very much for your help!


--
phil2006
------------------------------------------------------------------------
phil2006's Profile: http://www.excelforum.com/member.php...o&userid=35092
View this thread: http://www.excelforum.com/showthread...hreadid=566272

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
Search, Copy, Paste Macro in Excel [email protected] Excel Worksheet Functions 0 January 3rd 06 06:51 PM
Closing File Error jcliquidtension Excel Discussion (Misc queries) 4 October 20th 05 12:22 PM
macro with F9 Kenny Excel Discussion (Misc queries) 1 August 3rd 05 02:41 PM
Make Alignment options under format cells available as shortcut dforrest Excel Discussion (Misc queries) 1 July 14th 05 10:58 PM
Playing a macro from another workbook Jim Excel Discussion (Misc queries) 1 February 23rd 05 10:12 PM


All times are GMT +1. The time now is 06:51 AM.

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

About Us

"It's about Microsoft Excel"