Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Joseph
Try this example for column A Sub Find_First() Dim FindString As String Dim Rng As Range FindString = InputBox("Enter a Search value") If Trim(FindString) < "" Then Set Rng = Range("A:A").Find(What:=FindString, _ After:=Range("A" & Rows.Count), _ LookIn:=xlFormulas, _ LookAt:=xlWhole, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=False) If Not Rng Is Nothing Then Rows(Rng.Row & ":" & Rows.Count).Delete End If End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "Joseph" wrote in message om... VBA help needed for a beginner. I need to find a first instance of a string in first column and then to delete all the rows from the one in which the string was found to the end of the spreadsheet. Thanks, Joseph |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
To find rate of each item from item.xls and to copy price.xls | Excel Discussion (Misc queries) | |||
find and delete rows macro | Excel Discussion (Misc queries) | |||
find text and delete rows. | Excel Discussion (Misc queries) | |||
Find and delete all other rows | Excel Discussion (Misc queries) | |||
Macro to find and delete rows! | Excel Discussion (Misc queries) |