LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Macro to delete rows if they don't begin with "0"

Hi - and thanks for reading this.
I have a macro where I am trying to delete rows that don't begin with "0".
These are text cells (hence the apostrophes). The sample below deletes the
rows if they DO begin with "0" and I can't find out how to make it delete if
they DON'T being with "0". I've searched the group for ages - without
success. I've tried Not Like - but that doesn't work.
Thanks for your help (it's probably easy for you!)

Application.ScreenUpdating = False
For i = 90 To 3 Step -1
If Cells(i, 1).Value Like "0*" Then Rows(i).Delete
Next
Application.ScreenUpdating = True


 
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
delete rows if cell in row contains "a" or "o" or empty bartman1980 Excel Programming 2 November 4th 07 08:20 PM
Look for cell containing "Initial" then if the next cell after equals "Final" then delete both rows. [email protected][_2_] Excel Programming 3 September 28th 07 01:45 PM
Help with a "delete rows" Macro NewUser22 Excel Programming 1 April 20th 07 05:44 PM
Custom Menus & "Begin a Group" option JMMach[_2_] Excel Programming 5 June 12th 05 01:08 PM
Search "Total" in all worksheets and delete rows containing "Total" mk_garg20 Excel Programming 2 July 30th 04 06:42 AM


All times are GMT +1. The time now is 09:22 AM.

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

About Us

"It's about Microsoft Excel"