Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Once criteria has been met, delet the same row.

Tom

Thanks...that saved some of my brain cells. Hopefully it works for you Les

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS



Tom Ogilvy wrote:
Sub deleterows()
Dim lLastRow As Long
Dim x As Long
Dim arr as Variant
Dim i as long
arr = Array("AEPA", "ASPA", "AEPE", "AEPR", _
"ALPA", "AZPA", "AZPE" ,"LA" ,"LG" , "LU", "NB")
lLastRow = Range("A65536").End(xlUp).Row
For x = lLastRow To 1 Step -1
If UCase(Left(Range("A" & x).Offset(0, 2).Value, 1)) = "H" Then
Range("A" & x).EntireRow.Delete
Else
for i = lbound(arr) to ubound(arr)
if Instr(1,Range("A" &
x).Offset(0,2).Value,arr(i),vbTextCompare) Then Range("A"
& x).EntireRow.Delete Exit for
end if
Next
End If
Next x

End Sub

"Les Stout" wrote in message
...
Hi Nick/Don,

Thanks very much for the help, I really appreciate it.

Nick,

I also have the following and have tried to change the code to suit
but I cannot get it to work, Heeeelp ??

Like previously mentioned, I have1 10 starting with "H" and the rest
are, they must all be deleted;

AEPA, ASPA, AEPE, AEPR, ALPA, AZPA, AZPE ,LA ,LG , LU & NB.

I don't think i understand the language, as I tried changing the
code by changing "H" to "*PA", but it still did not work, has it
something to do with the for x ?

Can you use the wild card with as well?

As stated, I new to the game, but love it and very frustrated at this
stage, as I know what I want to do, but can't !!


Les Stout

*** Sent via Developersdex
http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



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
how to delet the blank rows in whole sheet at a time pp Excel Worksheet Functions 1 July 31st 09 11:07 AM
Delet Duplicate Blanks rows hardeep.kanwar[_16_] Excel Worksheet Functions 6 June 22nd 09 01:17 PM
delet multiple entries on same row(different columns) clcnewtoaccess Excel Discussion (Misc queries) 1 February 9th 09 09:20 PM
DELET PERTICULER WORD FROM THE EXCEL SHEET Amit Excel Worksheet Functions 2 September 15th 08 02:43 PM
how do I lock formulas, but still allow rows to be added or delet. ericaamousseau Excel Worksheet Functions 3 January 18th 08 07:10 PM


All times are GMT +1. The time now is 12:45 PM.

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"