Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I am a beginner a writing Macros in Excel. I have a Macro that deletes any
record that does not equal "Server/Midrange Software" in column M. I need to expand this to include other criteria. Such as, if column M does not equal "Server/Midrange Software" or does not equal "Data Telecom" then delete the record. The Macro I have currently is..... Sub TryMe() 'Deletes rows where the value in column M are not equal to Server/Midrange Software Dim RowMdx As Long Dim LastRow As Long LastRow = Cells(Rows.Count, "M").End(xlUp).Row For RowMdx = LastRow To 1 Step -1 If Cells(RowMdx, "M").Value < "Server/Midrange Software" Then Rows(RowMdx).Delete End If Next RowMdx End Sub How do I put the OR condition in this for Data Telecom and possibly more conditions? Any help appreciated,,,,,,thanks -- Mike |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Delete Row with condition | Excel Discussion (Misc queries) | |||
Macro to delete rows based on a condition | Excel Worksheet Functions | |||
How to delete lines programmatically if a condition is met? | Excel Discussion (Misc queries) | |||
Is there a way to delete a cell value based on a condition? | Excel Discussion (Misc queries) | |||
Can I delete an entire row if condition is not met? | Excel Worksheet Functions |