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

Hi all,

My previous post does get any answer (maybe to strange)

I have different sub that interfere with all selected cells on the active
worksheet.
If a non contiguous range of cells was selected using CTRL + mouse,
and, if accidentally, the same cell was clicked more than once, the
resulting range will
contain more than once the same cell address.
Hold down CTRL and click 3 time A1 :
in the immediate window -
? selection.address
$A$1,$A$1,,$A$1

Sub Test
dim cl as range
For each cl in selection
Debug.print cl.address
next cl
end sub
Result : 3 iterations

Question : how can I get the unique record(s) in that range and not get an
entry each time the user click the same cell - I known
, you click only once but still ?

Regards,
..
Jean-Yves


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Filter range array

Use Intersection to clean it up:

from the immediate window:

? selection.Address
$B$2,$C$2,$B$4,$C$2,$C$4,$B$2,$B$4
? Intersect(selection,selection).Address
$B$2:$C$2,$B$4:$C$4
intersect(selection,Selection).Select
? selection.Address
$B$2:$C$2,$B$4:$C$4

--
Regards,
Tom Ogilvy

"JY" wrote in message
...
Hi all,

My previous post does get any answer (maybe to strange)

I have different sub that interfere with all selected cells on the active
worksheet.
If a non contiguous range of cells was selected using CTRL + mouse,
and, if accidentally, the same cell was clicked more than once, the
resulting range will
contain more than once the same cell address.
Hold down CTRL and click 3 time A1 :
in the immediate window -
? selection.address
$A$1,$A$1,,$A$1

Sub Test
dim cl as range
For each cl in selection
Debug.print cl.address
next cl
end sub
Result : 3 iterations

Question : how can I get the unique record(s) in that range and not get an
entry each time the user click the same cell - I known
, you click only once but still ?

Regards,
.
Jean-Yves




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
Filter an array hntsignif Links and Linking in Excel 1 December 13th 08 12:48 PM
Conditional filter using array formula [email protected] Excel Worksheet Functions 6 June 10th 08 03:03 AM
Conditional filter using array formula [email protected] Excel Worksheet Functions 0 June 3rd 08 05:34 AM
"Criteria Range" in the "Data/Filter/Advanced Filter" to select Du TC Excel Worksheet Functions 1 May 12th 05 02:06 AM
Array Join & Filter funcs Kevin T. Ryan[_2_] Excel Programming 3 February 3rd 04 07:14 PM


All times are GMT +1. The time now is 08:51 AM.

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"