autofilter problem

R

Rpeled1

Hello.,
When I try to extract data from sheet like this
A B C .... M
9 145 a1
10 145 abc
11 146 def
12 146 hij

With ActiveSheet
lLastRow = .Cells.SpecialCells(xlCellTypeLastCell).Row
Set rng = Range("A1", Cells(lLastRow, "M"))
rng.AutoFilter field:=2, Criteria1:="146", VisibleDropDown:=False
rng.SpecialCells(xlCellTypeVisible).Copy
End With

The range include one row of '145', how can I ignore it, the sheet
comes without header but even with header the extracted data come with
the header line.

Thankes
Roni Peled
 
D

Dave Peterson

I'd add a header to the data.
Filter and do the copy
do the paste (???)
delete the header from the pasted range
delete the header from the original data
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top