Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro for auto deleting row if cell value = x

I'm looking for some visual basic help for the following scenario...

Column A contains cells values: x, y, z
I need macro to refer to column A, and delete entire row if cell value = y or z

I really appreciate your help! Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro for auto deleting row if cell value = x

FirstRow = number of first row of data
myColumn = number of column that you want to examine
Set myRange = Cells(FirstRow, myColumn).CurrentRegion
LastRow = myRange.Cells(myRange.Cells.Count).Row

For myRow = LastRow to FirstRow step -1
if cells(myRow, myColumn) = "x" the
cells(myRow,myColumn).entirerow.delete
Next myRo

--
Message posted from http://www.ExcelForum.com

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
Excel auto deleting zero at start of cell - change? SpclServFrtCo Excel Discussion (Misc queries) 2 November 26th 07 05:08 PM
Auto run macro depend on cell value Khaled Excel Worksheet Functions 2 April 25th 07 10:52 PM
Macro Help Needed: Comparing cell values and deleting rows [email protected] Excel Discussion (Misc queries) 1 September 19th 06 02:39 AM
Excel VBA - Newbie: Auto deleting cell value zoso69 Excel Programming 2 July 7th 04 09:03 AM
Deleting Cell Name from Macro LSB[_3_] Excel Programming 1 November 7th 03 08:56 AM


All times are GMT +1. The time now is 04:03 PM.

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"