result.jpgI have a function to calculate following :
Function FindValue(rng1 As Range, rng2 As Range, rng3 As Range, index As Integer) As String
Dim value As String
Dim n, i As Integer
Dim count As Integer
value = ""
count = 0
n = rng1.count
For i = 1 To n
If Application.WorksheetFunction.CountIf(rng2, rng1(i)) > 0 And Application.WorksheetFunction.CountIf(rng3, rng1(i)) = 0 Then
count = count + 1
If count = index Then
value = rng1(i)
Exit For
End If
End If
Next
FindValue = value
End Function
When I export output excel then I have result follow (imageerror.jpg) :
I have double click on cells have string "######" and press enter then the result appear.
I want to result appear when file open.
Please help me.Thanks so much
Bookmarks