Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks, Joel! That did the trick.
"Joel" wrote: It works, but you have to highlight the correct number of cells on the worksheet to get it to work. Also use Shift+Control+Enter "FrankJO" wrote: Update: I changed the code to what appears below, and I am no longer getting a value error, but it is only returning the first item in the array, when it should return all items in the array to a range of cells. Ideas? Revised Code: Public Function ExtractFundID(ByVal HoldingNameRange As Range) As Variant Dim HoldingName As Range Dim IDOutputList As Range Dim IDOutputArray() As String Dim OutputIndex As Integer Dim IDString As String OutputIndex = 0 For Each HoldingName In HoldingNameRange IDString = "" For Digi = 1 To Len(HoldingName) If IsNumeric(Mid(HoldingName, Digi, 1)) Then Chara = Mid(HoldingName, Digi, 1) IDString = IDString & Chara End If Next Digi OutputIndex = OutputIndex + 1 ReDim Preserve IDOutputArray(OutputIndex) IDOutputArray(OutputIndex - 1) = IDString Next HoldingName ExtractFundID = IDOutputArray End Function |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Redimming an array dynamically assigned from range (how to redim first dimension of a 2-D array? /or/ reverse the original array order) | Excel Programming | |||
Returning an array from a multi-dimensional array | Excel Programming | |||
Returning Array ... | Excel Programming | |||
Returning array ... | Excel Programming | |||
Returning an array from a UDF to a column range | Excel Programming |