Deleting and keeping rows in same Macro
Closed
Jess
-
Jul 26, 2010 at 08:03 AM
rizvisa1 Posts 4479 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Jul 28, 2010 at 09:21 AM
rizvisa1 Posts 4479 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Jul 28, 2010 at 09:21 AM
Related:
- Deleting and keeping rows in same Macro
- Excel macro to insert rows between data - Excel Forum
- Spell number in excel without macro - Guide
- Run macro when cell value changes - Guide
- How to delete whatsapp contact not in address book - Guide
- Macro excel download - Download - Spreadsheets
1 reply
rizvisa1
Posts
4479
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
767
Jul 26, 2010 at 08:18 AM
Jul 26, 2010 at 08:18 AM
Why you want to visit that cell again. If you know you have to delete the row, then delete it then. Some thing like this
Sub Delete() Dim rng As Range, cell As Range Dim strCellValue As String Set rng = Intersect(Range("H2:H1000"), ActiveSheet.UsedRange) For Each cell In rng strCellValue = (cell.Value) If InStr(strCellValue, "computer") = False Then If InStr(strCellValue, "laptop") = False Then On Error Resume Next cell.EntireRow.Delete On Error GoTo 0 End If End If Next cell End Sub
Jul 26, 2010 at 08:53 AM
Jul 26, 2010 at 09:26 AM
Jul 26, 2010 at 03:29 PM
Jul 26, 2010 at 07:42 PM
Jul 27, 2010 at 02:23 AM
In the uploaded document I have two macro's not finished yet. What I want is the following:
1#: Macro first keeps all the rows with "computer", "laptop", "latitude", etc.
2#: Macro looks at the kept rows again and deletes rows that include "geheugen", "module", "lamp", etc.
Is it possible to combine what I want in one macro? Thanks again.