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: 2
Default List of items in an array - VBA?

Hello

Excel 2003 query around VBA and how you access a Range

Consider two cols of data with people's favourite colour

A B
1) Fred Red
2) Sid Red
3) Bob Blue
4) Andy Reg
5) Steve Blue

What I want is to write the following
=funcWhoCol(A1:B5,"Blue")

The function will return a string containing the names of people whose
favourite colour matches the second parameter, in this case the strung
returned would be "Bob Steve"

I started to create a function and pass the range in as the first param
and the match string as the second but I can't find how to manipulate
the range in my function.

What I want is logically as shown below (although I have no idea about
how to do it so the code is nonsense)

function funcWhoCol is (inRange, inMatch)

for i_count = 1 to inRange.Cells.Count
if inRange(i_count) = inMatch then funcWhoCol = funcWhoCol +
inRange(i_count) + " "
next i_count

end function


Many thanks in advance
Craig

 
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
List and subtotal selected items, then print separate item list TitanG Excel Worksheet Functions 0 September 8th 08 09:07 PM
find each of the items in an array and save result in another array lif[_5_] Excel Programming 2 June 28th 06 01:54 AM
Data Validation: items in one list relate to items in another Paul D. Simon Excel Programming 1 August 4th 05 09:17 PM
named range, data validation: list non-selected items, and new added items KR Excel Discussion (Misc queries) 1 June 24th 05 05:21 AM
Items in disabled items list - unknown excel addins causing probs Rich Excel Programming 4 May 16th 05 10:31 PM


All times are GMT +1. The time now is 07:14 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"