unique range

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi All,

I created a unique range with this piece of code:
Dim allkodok As Range, osszsor As Range
darab = Columns("B:B").End(xlDown).Row
Set osszsor = Range("B1:B" & darab)
osszsor.AdvancedFilter Action:=xlFilterInPlace, Unique:=True
Set allkodok = osszsor.SpecialCells(xlVisible)

My problem is that range "allkodok" contains the header row (cell B1) and I
want to exclude it. I tried
Set allkodok = allkodok.Offset(1, 0).Resize(allkodok.Count - 1)
but it fails. Please help!

Regards,
Stefi
 
Set allkodok = allkodok.Offset(1, 0).Resize(allkodok.Rows.Count - 1)


--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)
 
Sorry Bob, it still doesn't work. I get a hint saying:

allkodok.Offset(1, 0).Resize...<Application-defined or object-defined error>

It seems as if Offset wouldn't work (perhaps because allkodok is NOT a
contiguous range).

Regards,
Stefi

„Bob Phillips†ezt írta:
 
Didn't realise allkodok is not contiguous. You will need to ignore row 1
when you create allkodok.

BTW, does autofilter work on a non-contiguous range?

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)
 

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

Back
Top