cogswel__cogs
Board Regular
- Joined
- Jan 3, 2018
- Messages
- 180
Is it possible to use find in formula as opposed to cells result.
Thanks for any help
Thanks for any help
That is correct. That is how Excel formulas work - they look at what is being returned in the cell, and not the formula behind it.Which I was hoping to pull result 24, only find is looking at the result of the cell not the formula text.
Function GetRow(rng As Range, fnd As String) As String
' rng = cell address where formula resides
' fnd = the string before the row number to look for
' Example: =GetRow(B2,":$F$")
Dim frm As String
Dim temp As String
Dim arr() As String
' Get formula from cell
frm = rng.Formula
' Get row number from formula
temp = Mid(frm, InStr(frm, fnd) + 4, 5)
arr = Split(temp, "&")
GetRow = arr(0)
End Function
=GetRow(B2,":$F$")