Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi There,
I have a large amount of consolidated data on a sheet called Master. I need some VB that looks only in column F for the word "Cleared". When it finds it, needs to select that line, and 3 beneath it (ie four in total) and delete those 4 rows, then move on to the next instance of cleared, select the 3 rows beneath it and delete all four rows, etc etc for all instances in that column.... Any ideas? Regars D *** Sent via Developersdex http://www.developersdex.com *** |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Darin,
Right click the sheet tab, view code and paste this in:- Sub sonic() lastrow = Range("F65536").End(xlUp).Row For x = lastrow To 1 Step -1 Cells(x, 6).Select If ActiveCell.Value = "Cleared" Then ActiveCell.EntireRow.Select Selection.Resize(4, 256).Select Selection.Delete Shift:=xlUp End If Next End Sub Mike "Darin Kramer" wrote: Hi There, I have a large amount of consolidated data on a sheet called Master. I need some VB that looks only in column F for the word "Cleared". When it finds it, needs to select that line, and 3 beneath it (ie four in total) and delete those 4 rows, then move on to the next instance of cleared, select the 3 rows beneath it and delete all four rows, etc etc for all instances in that column.... Any ideas? Regars D *** Sent via Developersdex http://www.developersdex.com *** |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Shapes beneath cell text? | Excel Discussion (Misc queries) | |||
Find and Replace - delete the remainder of the text in the cell after my Find | Excel Programming | |||
find text delete row | Excel Programming | |||
Excel Macro find non zero value in cell and insert row beneath | Excel Programming | |||
find and delete text, find a 10-digit number and put it in a textbox | Excel Programming |