View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
andreashermle andreashermle is offline
external usenet poster
 
Posts: 123
Default Extract item numbers with suffix -09 and copy them below theactual list

On Jun 17, 12:10*pm, Ron Rosenfeld wrote:
On Thu, 17 Jun 2010 00:15:45 -0700 (PDT), andreashermle

wrote:

Hi Ron,


great. This works just fine. Thank you very much for your professional
help. Regards, Andreas


I was wrong about Don's Macro. *He uses the Auto filter whereas my
method uses the Advanced Filter.

If you were going to use a macro with the Advanced filter, it would
look like:

=========================
Option Explicit
Sub GetItems()
*Dim rCriteria As Range
*Dim rSrc As Range
*Dim rDest As Range

*'Could use an input box to set up criteria
*'for extracting numbers

'Assume Data starts in A1, with headers
'in first row

Set rSrc = Range("A1").CurrentRegion
Set rDest = rSrc.End(xlDown).Offset(2)

'Use some unused area for the Criteria Range
Set rCriteria = Range("AA1:AA2")
*rCriteria(1) = rSrc(1) 'Copy Header
*rCriteria(2) = "*-09"

* * rSrc.AdvancedFilter Action:=xlFilterCopy, _
* * *CriteriaRange:=rCriteria, CopyToRange:=rDest, Unique:=False

End Sub
=================================


Hi Ron,

I really appreciate your great support and your giving me insight in
some many things.
Thank you very much. It works just fine.

Regards, Andreas