Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
My Below Sub accepts a string, finds it and deletes the row in which the
string is found. Can someone help me modify it to continue searching through all cells that contain data and delete any other rows where the string occurs? USAGE: DeleteRowswString("myword") CODE Sub DeleteRowwString(ByVal sString As String) Dim theRange As Range, nCells As Integer, I As Integer Set theRange = Selection nCells = theRange.Cells.Count For I = nCells To 1 Step -1 If theRange.Cells(I).Value = sString Then theRange.Cells(I).EntireRow.Delete End If Next End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Not Looping | Excel Discussion (Misc queries) | |||
Looping through Sheet | Excel Programming | |||
looping through selected sheet tabs | Excel Programming | |||
Looping | Excel Programming | |||
looping to End | Excel Programming |