Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
AthleteTO
 
Posts: n/a
Default Stumped! Collecting values into one cell.


Kind thanks Bernie, and three cheers for your easy to implement
solution!

Drew

Bernie Deitrick Wrote:

Drew,

You could use a User-Defined-Function, definition below. Copy the code
and
paste into a standard codemodule of your workbook. Used like:

=Nodes(A2,Sheet1!$B$2:$B$7,Sheet1!$A$2:$A$7)

Where A2 has the reuse code you are interested in, B2:B7 of Sheet1 has
the
reuse code table, and A2:A7 of Sheet1 has the Node values.

HTH,
Bernie
MS Excel MVP

Function Nodes(inVal As Range, _
InCode As Range, _
InNode As Range) As Variant

Dim i As Integer

Nodes = "None"

If InCode.Cells.Count < InNode.Cells.Count Then
Nodes = "Unbalanced entry ranges"
Exit Function
End If

If inVal.Cells.Count < 1 Then
Nodes = "Too many key values"
Exit Function
End If

For i = 1 To InCode.Cells.Count
If InCode.Cells(i).Value = inVal.Value Then
If Nodes = "None" Then
Nodes = InNode.Cells(i).Value
Else
Nodes = Nodes & ", " & InNode.Cells(i).Value
End If
End If
Next i

End Function



--
AthleteTO
------------------------------------------------------------------------
AthleteTO's Profile: http://www.excelforum.com/member.php...o&userid=15943
View this thread: http://www.excelforum.com/showthread...hreadid=274218

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
Remove the apostrophe (') in Excel cell text values Connull Excel Discussion (Misc queries) 5 January 11th 05 05:06 PM
display negative values as a blank cell in Excel pherozeb Excel Discussion (Misc queries) 3 January 5th 05 04:40 AM
display negative values as a blank cell in Excel Pheroze Bharucha Excel Discussion (Misc queries) 0 January 4th 05 10:51 PM
How to display cell values in wordarts? Anderson Lee Excel Discussion (Misc queries) 2 December 28th 04 03:05 PM
Stumped! Collecting values into one cell. AthleteTO Excel Worksheet Functions 5 November 2nd 04 04:24 PM


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