Help with Row Delete Macro
Posted by Ben O. on June 21, 2001 1:29 PM
Here's my row delete macro. It gets its values from a user form. It doesn't work most of the time, and when it works it works erractically. I don't get any errors, it just doesn't delete any rows. Can anyone tell me what's wrong?
Private Sub OKButton_Click()
Dim myRow As Integer
Dim myCol As Integer
myCol = ColBox.Value
cValue = ValueBox.Value
rBegin = rBeginBox.Value
rEnd = rEndBox.Value
For myRow = rBegin To rEnd Step 1
If Cells(myRow, myCol).Value = cValue Then
Cells(myRow, myCol).EntireRow.Delete
End If
Next myRow
Unload CondRowDel
End Sub
Thanks,
-Ben