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 range of unique cells

Hi All,

If I make a unique list with advanced filter, how can I define the range
consisting of the unique cell, e.g. if in Range("A8:A23") cells A8, A9, A11,
A15, A16 remained visible after fitering then what is the statement to define
a range consisting A8, A9, A11, A15, A16 cells?


Range("A8:A23").AdvancedFilter Action:=xlFilterInPlace, Unique:=True
set uniqcells = ???

--
Thanks!
Stefi

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 834
Default range of unique cells

Set uniqcells = Range("A8:A23").SpecialCells(xlCellTypeVisible)

HTH

Bob

"Stefi" wrote in message
...
Hi All,

If I make a unique list with advanced filter, how can I define the range
consisting of the unique cell, e.g. if in Range("A8:A23") cells A8, A9,
A11,
A15, A16 remained visible after fitering then what is the statement to
define
a range consisting A8, A9, A11, A15, A16 cells?


Range("A8:A23").AdvancedFilter Action:=xlFilterInPlace, Unique:=True
set uniqcells = ???

--
Thanks!
Stefi



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

Thanks to all of you, it worked.

I mislead myself when I tried this solution by myself and wanted to check
the result with uniqcells.rows.count which gave 3 and it was wrong. Later I
found out that uniqcells.count gives the right result, while
uniqcells.rows.count gives the number of rows in the first contiguous part of
uniqcells, it's really 3, but I still don't understand the reason of
differing the number of rows and the number of cells in a one column wide
range. Could you explain it?

Thanks!
Stefi



€˛Bob Phillips€¯ ezt Ć*rta:

Set uniqcells = Range("A8:A23").SpecialCells(xlCellTypeVisible)

HTH

Bob

"Stefi" wrote in message
...
Hi All,

If I make a unique list with advanced filter, how can I define the range
consisting of the unique cell, e.g. if in Range("A8:A23") cells A8, A9,
A11,
A15, A16 remained visible after fitering then what is the statement to
define
a range consisting A8, A9, A11, A15, A16 cells?


Range("A8:A23").AdvancedFilter Action:=xlFilterInPlace, Unique:=True
set uniqcells = ???

--
Thanks!
Stefi



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 834
Default range of unique cells

In a one column range they should be the same. Are you sure your range was
just one column wide?

HTH

Bob

"Stefi" wrote in message
...
Thanks to all of you, it worked.

I mislead myself when I tried this solution by myself and wanted to check
the result with uniqcells.rows.count which gave 3 and it was wrong. Later
I
found out that uniqcells.count gives the right result, while
uniqcells.rows.count gives the number of rows in the first contiguous part
of
uniqcells, it's really 3, but I still don't understand the reason of
differing the number of rows and the number of cells in a one column wide
range. Could you explain it?

Thanks!
Stefi



"Bob Phillips" ezt ķrta:

Set uniqcells = Range("A8:A23").SpecialCells(xlCellTypeVisible)

HTH

Bob

"Stefi" wrote in message
...
Hi All,

If I make a unique list with advanced filter, how can I define the
range
consisting of the unique cell, e.g. if in Range("A8:A23") cells A8, A9,
A11,
A15, A16 remained visible after fitering then what is the statement to
define
a range consisting A8, A9, A11, A15, A16 cells?


Range("A8:A23").AdvancedFilter Action:=xlFilterInPlace, Unique:=True
set uniqcells = ???

--
Thanks!
Stefi



.



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

Hi Bob,

I checked again: the range was definitely one column wide.

uniqcells.rows.count gave 3 while uniqcells.count gave 8 which was right.

When I increased the width to 2 for testing purposes, uniqcells.rows.count
gave still 3 while uniqcells.count gave 2*8=16 which was also right.

--
Regards!
Stefi



€˛Bob Phillips€¯ ezt Ć*rta:

In a one column range they should be the same. Are you sure your range was
just one column wide?

HTH

Bob

"Stefi" wrote in message
...
Thanks to all of you, it worked.

I mislead myself when I tried this solution by myself and wanted to check
the result with uniqcells.rows.count which gave 3 and it was wrong. Later
I
found out that uniqcells.count gives the right result, while
uniqcells.rows.count gives the number of rows in the first contiguous part
of
uniqcells, it's really 3, but I still don't understand the reason of
differing the number of rows and the number of cells in a one column wide
range. Could you explain it?

Thanks!
Stefi



"Bob Phillips" ezt Ć*rta:

Set uniqcells = Range("A8:A23").SpecialCells(xlCellTypeVisible)

HTH

Bob

"Stefi" wrote in message
...
Hi All,

If I make a unique list with advanced filter, how can I define the
range
consisting of the unique cell, e.g. if in Range("A8:A23") cells A8, A9,
A11,
A15, A16 remained visible after fitering then what is the statement to
define
a range consisting A8, A9, A11, A15, A16 cells?


Range("A8:A23").AdvancedFilter Action:=xlFilterInPlace, Unique:=True
set uniqcells = ???

--
Thanks!
Stefi



.



.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default range of unique cells

Hi

Set uniqcells = Range("A8:A23").SpecialCells(xlCellTypeVisible)

Just remeber that when using a filter, excel expect A8 (first row) to be a
header, and not a part of the filtered values.

Regards,
Per

"Stefi" skrev i meddelelsen
...
Hi All,

If I make a unique list with advanced filter, how can I define the range
consisting of the unique cell, e.g. if in Range("A8:A23") cells A8, A9,
A11,
A15, A16 remained visible after fitering then what is the statement to
define
a range consisting A8, A9, A11, A15, A16 cells?


Range("A8:A23").AdvancedFilter Action:=xlFilterInPlace, Unique:=True
set uniqcells = ???

--
Thanks!
Stefi

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 65
Default range of unique cells

On Feb 16, 4:23*pm, Stefi wrote:
Hi All,

If I make a unique list with advanced filter, how can I define the range
consisting of the unique cell, e.g. if in Range("A8:A23") cells A8, A9, A11,
A15, A16 remained visible after fitering then what is the statement to define
a range consisting A8, A9, A11, A15, A16 cells?

Range("A8:A23").AdvancedFilter Action:=xlFilterInPlace, Unique:=True
set uniqcells = ???

--
Thanks!
Stefi


untried, but perhaps:

Range("A8:A23").AdvancedFilter Action:=xlFilterInPlace, Unique:=True
Set uniqcells = range("A8:A23").SpecialCells(xlCellTypeVisible)
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
function to only show unique cells in range (e.g. B2:B20) OnTheEdge Excel Worksheet Functions 6 November 11th 08 02:03 AM
Sum of unique values within a range with blank cells loook Excel Worksheet Functions 3 May 12th 08 03:11 PM
unique list from a range of cells elaine Excel Programming 5 March 13th 07 06:37 PM
Counting Unique Empty Cells of a Range IronDogg Excel Programming 5 April 9th 06 04:48 PM
defining unique range of cells for different sheets as the same n. KSAPP Excel Discussion (Misc queries) 1 March 30th 05 07:18 PM


All times are GMT +1. The time now is 09:27 PM.

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

About Us

"It's about Microsoft Excel"