Dear all,
I am new to this forum and decided to pose you a question that drives me nuts.
I want to create a function that has 2 arguments:
- A single cell that contains a string = Role
- A range of cells containing strings = RangeR
I compare the content of Role to the content of each of the cells in RangeR.
As an example code I then return the value of the second comparison.
Could some check what I did wrong in my code?:
Code:
Function getresponsible(Role As String, RangeR As Range)
Dim MatchingArray(1 To 5) As Boolean
Dim dum As Boolean
For i = 1 To 5
dum = Application.WorksheetFunction.Search(Role, RangeR(1, i))
MatchingArray(i) = Application.WorksheetFunction.IsNumber(dum)
Next i
getresponsible = MatchingArray(2)
End Function
https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA
Bookmarks