Mrrrr
AdMiN
 Inregistrat: acum 18 ani
Postari: 2251
|
|
Source:
How to Remove all Rows Containing Certain Data
1. Select all of your data, including the data you wish to remove.
2. Press Ctrl F to open the Find and Replace dialog.
3. Type the text that is contained in the rows you wish to delete. For example if you need to delete rows with someone’s name, type that name in.
4. Click the Find All button. This will show a list of all cells containing the data you searched for below the search box.
Important note: if the text you are looking for is the result of a formula (eg. the word FALSE returned from an IF formula), then before pressing Find All, under Look in dropdown select Values.
5. Click on one of the results that appear below the search box, then press Ctrl A. All results should be highlighted now. Also, if you notice on your spreadsheet, each cell containing what you searched for will be selected.
6. Click the Close button on the Find and Replace window.
7. Press Ctrl and minus key to open the Delete window.
8. Select the Entire Row option, and press the OK button.
Remove Certain Rows Containing Certain Data with VBA
Sub Delete_All_Rows_IF_Cell_Contains_Certain_String_Text() Dim lRow As Long Dim iCntr As Long lRow = 1000 For iCntr = lRow To 1 Step -1 If Cells(iCntr, 3).Value = "Certain data to delete here" Then Rows(iCntr).Delete End If Next End Sub |
Number “3” in the ‘If Cells (iCntr, 3).Value represents the third column (C) lRow = 1000 means it will check the first 1000 rows.
_______________________________________

|
|