View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default selecting a range from a list

just apply an autofilter to the data

Data=filter=Autofilter

in the id column, select 1-5 from the dropdown, select all the data and
copy,
then go to the destination and do Edit=Paste

Turn on the macro recorder while you do this and you will have tha basic
code you need. You don't need to sort. Only the visible cells will be
copied and pasted by default.

--
Regards,
Tom Ogilvy


"Y.Kim" wrote in message
...
i am importing a list and i only need part of the list for
my report. my list contains data with columns id, acct,
security, coupon, maturity, principal. i only need to work
with data that has an id of 1-5. a lot of the data in the
list doesn't have an id. so after i sort the list i only
need to select the data with id 1-5 then copy that
selection and paste into sheet 2.

can't figure out a vba solution to this. can anyone one
give guidance.

tks.