hmltnangel
Active Member
- Joined
- Aug 25, 2010
- Messages
- 290
- Office Version
- 365
- Platform
- Windows
Hi Excel people,
I have a Function in VBA that a formula is calling up. But its recently started just giving me a #Value error.Any suggestions?
VBA Function: (Is in a Module in VBA)
Then the formula is:
=MultipleLookupNoRept(A2,Resource,4)
I have a Function in VBA that a formula is calling up. But its recently started just giving me a #Value error.Any suggestions?
VBA Function: (Is in a Module in VBA)
VBA Code:
Function MultipleLookupNoRept(Lookupvalue As String, LookupRange As Range, ColumnNumber As Integer)
Dim i As Long
Dim Result As String
For i = 1 To LookupRange.Columns(1).Cells.Count
If LookupRange.Cells(i, 1) = Lookupvalue Then
For J = 1 To i - 1
If LookupRange.Cells(J, 1) = Lookupvalue Then
If LookupRange.Cells(J, ColumnNumber) = LookupRange.Cells(i, ColumnNumber) Then
GoTo Skip
End If
End If
Next J
Result = Result & " " & LookupRange.Cells(i, ColumnNumber) & ","
Skip:
End If
Next i
MultipleLookupNoRept = Left(Result, Len(Result) - 1)
End Function
Then the formula is:
=MultipleLookupNoRept(A2,Resource,4)