I am converting a spreadsheet from Excel 2007 to Mac Excel 2011. I have tried for hours to solve my problem, without success, so any help would be appreciated!
This UDF finds a string in a range, then returns the value one cell below the found cell. The SET command returns nothing in the Mac version, but works in Excel 2007.
Function FindRng(Fnd As String)
Application.Volatile
Dim Rng As Range
If Fnd = "" Then
FindRng = 0
GoTo 109
End If
With Sheets("Matrix").Range("G2:FZ13")
Set Rng = .Find(What:=Fnd, _
After:=.Cells(2, 7), _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not Rng Is Nothing Then
FindRng = Sheets("Matrix").Cells(Rng.Row + 1, Rng.Column).Value
Else
FindRng = 0
End If
End With
109 End Function