Thread: dim problem
View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
Lonnie M. Lonnie M. is offline
external usenet poster
 
Posts: 184
Default dim problem

Hi Annette, I think you want to replace the rw's with in your loop with
"i":

Sub undistributed()
Dim rw As Long
Dim i As Long
Dim res As Variant
Dim list As Variant
rw = Cells(Rows.Count, "F").End(xlUp).Row
list = Array("DRH1", "DRH2", "DRH3", "DRI1", _
"DRI2", "DRI3", "DRIA", "DRIB")
For i = rw To 1 Step -1
res = Application.Match(Cells(i, "F").Value, list, 0)
If Not IsError(res) Then
Cells(i, "F").EntireRow.Delete
End If
Next
End Sub

HTH--Sorry about giving you the wrong variable type for rw above, I
must have still been dazed from lunch--Lonnie M.