Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hello,
I searched and tried myself, but to no avail on how to do this. I want to delete all rows below a certain value on multiple worksheets (I am importing multiple text files @ once). I need to delete all rows below the phrase "detail as follows". I can't just delete the rows by highlighting all worksheets at once as each different worksheet has the phrase "detail as follows" on different lines. Any ideas? |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Try this for one worksheet (Sheet1), it look in the A column
If it is working OK then we can make a loop through all sheets Sub Find_Test() Dim FindString As String Dim Rng As Range FindString = "detail as follows" With Sheets("Sheet1").Range("A:A") Set Rng = .Find(What:=FindString, _ After:=.Cells(.Cells.Count), _ LookIn:=xlValues, _ LookAt:=xlWhole, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=False) If Not Rng Is Nothing Then Rng.Parent.Rows(Rng.Row + 1 & ":" & Rng.Parent.Rows.Count).Delete Else MsgBox "Nothing found" End If End With End Sub -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm wrote in message ... Hello, I searched and tried myself, but to no avail on how to do this. I want to delete all rows below a certain value on multiple worksheets (I am importing multiple text files @ once). I need to delete all rows below the phrase "detail as follows". I can't just delete the rows by highlighting all worksheets at once as each different worksheet has the phrase "detail as follows" on different lines. Any ideas? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Delete Blank Rows Code - Multiple Worksheets - Multiple Documents | Excel Discussion (Misc queries) | |||
Add or Delete Rows in Protected worksheets | Excel Discussion (Misc queries) | |||
insert or delete rows across multiple worksheets? | Excel Discussion (Misc queries) | |||
delete rows from multiple worksheets | Excel Worksheet Functions | |||
Can you delete multiple worksheets with one command? | Excel Worksheet Functions |