Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Needs a FindNext as well
Dim oCell As Range Dim sAddress As String With Cells Set oCell = Nothing Set oCell = .Find(What:="Report", _ After:=ActiveCell, _ LookIn:=xlFormulas, _ LookAt:=xlPart, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=False) If Not oCell Is Nothing Then sAddress = oCell.Address Do oCell.Offset(1, 0).Resize(5, 1).EntireRow.Delete Shift:=xlUp Set oCell = .FindNext(oCell) Loop While Not oCell Is Nothing And oCell.Address < sAddress End If End With -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "dabith " wrote in message ... Hey Bob I tried your code but it goes into a continous loop. I played around with it to output a msg box to no avail. Any ideas??? Dim oCell As Range Do Set oCell = Nothing Set oCell = Cells.Find(What:="1", _ After:=ActiveCell, _ LookIn:=xlFormulas, _ LookAt:=xlPart, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=False) If Not oCell Is Nothing Then 'oCell.Offset(1, 0).Resize(5, 1).EntireRow.Delete Shift:=xlUp freq = 1 freq = freq + 1 MsgBox "No. of freq: " & freq End If Loop Until oCell Is Nothing Thanks --- Message posted from http://www.ExcelForum.com/ |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Loop question | Excel Discussion (Misc queries) | |||
Loop question | Excel Discussion (Misc queries) | |||
One more loop question | Excel Programming | |||
another loop question | Excel Programming | |||
For loop question | Excel Programming |