Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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" wrote in message
...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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" wrote in message
...
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default 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" wrote in message
...
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" wrote in message
...
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I select Multiple Items in a Chart Brooks Charts and Charting in Excel 3 April 4th 23 10:16 AM
Drop Down List - Select Multiple Items VLH Excel Worksheet Functions 14 October 16th 18 01:55 PM
select multiple items from a dropdown list Rebecca1 Excel Worksheet Functions 0 July 17th 06 08:47 PM
how do I select one from multiple items Jono Excel Discussion (Misc queries) 0 March 15th 06 02:08 PM
Select multiple items in a listbox uecem[_4_] Excel Programming 2 November 26th 04 02:00 AM


All times are GMT +1. The time now is 12:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"