Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
modifications on the code
Hi, Group:
I need your help to modify my code. Here is what I expect: In Column A under sheet1 with unknown rows, I always want to keep the first 3 rows. For the rest other than the first 3 rows, I need a maco to delete any rows if the cell value is NONE of "Apple", "Orange", or "Banana". Here is my code: Sub DeleteRows() Dim RangeColumnA As Range Dim j As Range With Worksheets("Sheet1") Set RangeColumnA = .Range("A4", .Range("A" & Rows.Count).End(xlUp)) End With Application.ScreenUpdating = False For Each j In RangeColumnA If NOT j.Value = "Apple" Or j.Value = "Orange" or j.Value = "Banana" Then j.EntireRow.Delete End If Next j Application.ScreenUpdating = True End Sub Please advise! George |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
IF Statement Modifications | Excel Worksheet Functions | |||
turn off excel cell modifications? | Excel Discussion (Misc queries) | |||
webbrowser - excel - modifications | Excel Discussion (Misc queries) | |||
Disable Border and Other Format Modifications | Excel Programming | |||
Modifications to Permutation Macro | Excel Programming |