Thread: dim problem
View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Annette[_4_] Annette[_4_] is offline
external usenet poster
 
Posts: 35
Default dim problem

oops ... is not an error .. just doesn't do anything ... no errors .. just
doesn't perform.

"Annette" wrote in message
...
Followed all the suggested and still getting an error so I'm copying with
all the past changes from your suggestions ... I know this can work, just
that I'm too dumb to know how to do:

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(rw, "F").Value, list, 0)
If Not IsError(res) Then
Cells(rw, "F").EntireRow.Delete
End If
Next
End Sub

"Norman Jones" wrote in message
...
Hi Annette,

In addition to Bob's response,

Dim rw As Long

Also, change:

set rw = cells(rows.count,"F").End(xlup)


to

rw = Cells(Rows.Count, "F").End(xlUp).Row


---
Regards,
Norman



"Annette" wrote in message
...
Because I am not real skilled at this, I understand what Option

Explicit
means and that I have to dim certain pieces of code .. I do not know

what
to
dim as I'm getting an error for the rw in this code. Can someone help

me
with this?
_____________________
set rw = cells(rows.count,"F").End(xlup)

list = Array("DRH1", "DRH2", "DRH3", "DRI1", _

"DRI2","DRI3", "DRIA", "DRIB")

for i = rw to 1 step -1

res = Application.Match(cells(rw,"F").Value,list,0)

if not iserror(res) then

cells(rw,"F").EntireRow.delete

end if

Next