LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default array output to cell range

I have three arrays
one array is a range array used as in input to my function
the second array has elements that i want to sent each element to a range
array (the third array)

workseet cell formula: =Count_duplicates(A2:A10, C2:C10)

VBA function:

Function Count_duplicates(ArrayIn, PutDupWhereArray) As Variant
Dim Num_Dups As Long
Dim Num_Blanks As Long
Dim ArrayItems_Duplicates() As Variant ' an array to put duplicates found in
'
Num_Dups = 0
ReDim ArrayItems_Duplicates(0)
'
For Each Element In ArrayIn
If Element 1 Then
ReDim Preserve ArrayItems_Duplicates(Num_Dups)
ArrayItems_Duplicates(Num_Dups) = Element
Num_Dups = Num_Dups + 1
End If
Next Element
Num_Dups = Num_Dups / 2 ' div by to to get actual duplicate pairs
For Each Element In ArrayItems_Duplicates

'Code that takes each element in array and puts it in
' PutDupWhereArray range array i.e. C2:C10

Next Element
Count_duplicates = Num_Dups
End Function

Thanks for any help
 
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
Forumla that Looks up a range of output from one cell DKinNorthCakalacki Excel Worksheet Functions 2 August 27th 08 03:45 AM
Output - Results of an Array [email protected] Excel Programming 1 October 3rd 06 07:02 PM
Search range of cells, find a value, output adjoining cell. How? nyys Excel Worksheet Functions 3 January 5th 06 01:48 PM
Array as output of function maca Excel Programming 4 July 15th 05 12:59 PM
Help with 1 x 2 array output jomni[_3_] Excel Programming 3 April 2nd 04 03:49 PM


All times are GMT +1. The time now is 04:01 AM.

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"