Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default unique range

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,726
Default unique range

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


--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"Stefi" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default unique range

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:

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


--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"Stefi" wrote in message
...
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




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,726
Default unique range

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)


"Stefi" wrote in message
...
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:

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


--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"Stefi" wrote in message
...
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






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default unique range

Set osszsor = Range("B2:B" & darab) 'ignore B1

Mike F

"Stefi" wrote in message
...
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:

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


--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"Stefi" wrote in message
...
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






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
unique records in specified range adimar Excel Worksheet Functions 5 May 29th 08 06:59 PM
How do I get the unique values from a range? DaveO Excel Worksheet Functions 13 January 13th 06 12:55 AM
Highest Value from Unique range Odysseus Excel Worksheet Functions 3 November 24th 04 02:31 PM
New Range containing Unique names only Steve Excel Programming 2 October 2nd 04 12:41 AM
Unique numbers in a range Todd Huttenstine[_3_] Excel Programming 1 January 20th 04 02:22 PM


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

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

About Us

"It's about Microsoft Excel"