+ Reply to Thread
Results 1 to 4 of 4

Possible to select and delete multiple items

  1. #1
    Annette
    Guest

    Possible to select and delete multiple items

    If I had a spreadsheet with worker ids in column F and I wanted to select
    and delete a couple different ids at the same time, is this possible?

    They start out CSC1, then jump to DRA1 through DRZZ ... in the middle are
    the ones I don't want deleted (for example: DRH1, DRH2, DRH3, DRI1, DRI2,
    DRI3, DRIA, DRIB, etc.)

    Is this possible?

    Thanks,

    Annette



  2. #2
    Bob Phillips
    Guest

    Re: Possible to select and delete multiple items

    Select the first, Shift-Select the last, then Delete.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Annette" <[email protected]> wrote in message
    news:[email protected]...
    > If I had a spreadsheet with worker ids in column F and I wanted to select
    > and delete a couple different ids at the same time, is this possible?
    >
    > They start out CSC1, then jump to DRA1 through DRZZ ... in the middle are
    > the ones I don't want deleted (for example: DRH1, DRH2, DRH3, DRI1, DRI2,
    > DRI3, DRIA, DRIB, etc.)
    >
    > Is this possible?
    >
    > Thanks,
    >
    > Annette
    >
    >




  3. #3
    Tom Ogilvy
    Guest

    Re: Possible to select and delete multiple items

    is there a rule to apply to decide which ones to delete, or do you just need
    to compare each row to a list of IDs you want to delete?

    If the latter, then that is basically what you would need to do - compare
    each row to a list. There are many different ways to approach that. Is the
    list of id's in a worksheet in another location?

    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


    another way

    set rw = cells(rows.count,"F").End(xlup)
    list = Array("DRH1", "DRH2", "DRH3", "DRI1", _
    "DRI2","DRI3", "DRIA", "DRIB")
    for i = lbound(list) to ubound(list)
    set rng = Range(cells(1,"F"),cells(rw,"F"))
    res = Application.Match(list(i),rng,0)
    if not iserror(res) then
    rng(res).EntireRow.delete
    end if
    Next


    and there are others


    --
    Regards,
    Tom Ogilvy

    "Annette" <[email protected]> wrote in message
    news:[email protected]...
    > If I had a spreadsheet with worker ids in column F and I wanted to select
    > and delete a couple different ids at the same time, is this possible?
    >
    > They start out CSC1, then jump to DRA1 through DRZZ ... in the middle are
    > the ones I don't want deleted (for example: DRH1, DRH2, DRH3, DRI1, DRI2,
    > DRI3, DRIA, DRIB, etc.)
    >
    > Is this possible?
    >
    > Thanks,
    >
    > Annette
    >
    >




  4. #4
    Annette
    Guest

    Re: Possible to select and delete multiple items

    This is excellent .. let me start with this as I'm thinking the first code
    will work.


    "Tom Ogilvy" <[email protected]> wrote in message
    news:[email protected]...
    > is there a rule to apply to decide which ones to delete, or do you just

    need
    > to compare each row to a list of IDs you want to delete?
    >
    > If the latter, then that is basically what you would need to do - compare
    > each row to a list. There are many different ways to approach that. Is

    the
    > list of id's in a worksheet in another location?
    >
    > 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
    >
    >
    > another way
    >
    > set rw = cells(rows.count,"F").End(xlup)
    > list = Array("DRH1", "DRH2", "DRH3", "DRI1", _
    > "DRI2","DRI3", "DRIA", "DRIB")
    > for i = lbound(list) to ubound(list)
    > set rng = Range(cells(1,"F"),cells(rw,"F"))
    > res = Application.Match(list(i),rng,0)
    > if not iserror(res) then
    > rng(res).EntireRow.delete
    > end if
    > Next
    >
    >
    > and there are others
    >
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    > "Annette" <[email protected]> wrote in message
    > news:[email protected]...
    > > If I had a spreadsheet with worker ids in column F and I wanted to

    select
    > > and delete a couple different ids at the same time, is this possible?
    > >
    > > They start out CSC1, then jump to DRA1 through DRZZ ... in the middle

    are
    > > the ones I don't want deleted (for example: DRH1, DRH2, DRH3, DRI1,

    DRI2,
    > > DRI3, DRIA, DRIB, etc.)
    > >
    > > Is this possible?
    > >
    > > Thanks,
    > >
    > > Annette
    > >
    > >

    >
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1