Re: dim problem

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Norman Jones (normanjones_at_whereforartthou.com)
Date: 01/07/05


Date: Fri, 7 Jan 2005 17:36:16 -0000

Hi Annette,

Try:

Sub Tester()
    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

---
Regards,
Norman
"Annette" <Samm@hotmail.com> wrote in message 
news:u2vts6N9EHA.3416@TK2MSFTNGP09.phx.gbl...
> grrrr .. still not working with all this helpful information ... here's 
> the
> code with the additives:
>
> Dim i As Long
> Dim list As Variant
> Dim res As Variant
> Dim rw As Range
>
> rw = Cells(Rows.Count, "F").End(xlUp).Row
> 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
>
> "Bob Phillips" <bob.phillips@notheretiscali.co.uk> wrote in message
> news:O9y0BgN9EHA.1300@TK2MSFTNGP14.phx.gbl...
>> And
>>
>> Dim i As Long
>> Dim list As Variant
>> Dim res As Variant
>>
>> -- 
>>
>> HTH
>>
>> RP
>> (remove nothere from the email address if mailing direct)
>>
>>
>> "Lonnie M." <lonnie_r_m@hotmail.com> wrote in message
>> news:1105114703.447163.190280@f14g2000cwb.googlegroups.com...
>> > Hi,
>> > Dim rw As Range
>> >
>> > HTH--Lonnie M.
>> >
>>
>>
>
> 


Relevant Pages

  • Re: Trouble with looping
    ... Function SpecLookup(VRN As Variant) As Variant ... Dim testRng As Range ... > Dim iCtr As Integer ... > Dim res As Variant ...
    (microsoft.public.excel.programming)
  • Re: shape range help
    ... However initial use of Dim() avoided use of brackets and he ... Everytime with ReDim only, I get a Variant() ... never in a session I don't do the initial Dim varr() then redim does NOT ...
    (microsoft.public.excel.programming)
  • Re: Coding with varsortby and options
    ... Dim varhowsort As Variant ... DoCmd.OpenReport stDocName, acViewPreview ...
    (microsoft.public.access.formscoding)
  • Re: shape range help
    ... However initial use of Dim() avoided use of brackets and he ... Everytime with ReDim only, I get a Variant() ... Dim Stooges As ShapeRange ...
    (microsoft.public.excel.programming)
  • Re: OPENFILENAME A P I. User cancels ?
    ... The variable FName will be a Boolean False if no file was selected or a String containing the fully qualified file name if the user selectes a file. ... Const ahtOFN_OVERWRITEPROMPT = &H2 ... Function GetOpenFile(Optional varDirectory As Variant, ... Dim strFilter As String ...
    (microsoft.public.excel.programming)