in UDF INDIREKT verwenden
18.09.2013 15:38:59
Peter
In meiner Tabelle stehen verschiedene Formeln, so auch in Zelle E6.
Nun möchte ich in Zelle B17 mit =showformula(6;INDIREKT(intspanr(A17))) die Formel abfragen - in A17 ist der Buchstabe E eingetragen
Da Formel liefert mir jedoch den Fehlerwert #WERT!
Mit =showformula(6;ZEILE()-12) klappt es dann.
Weshalb kann ich in meiner Formel INDIREKT nicht verwenden?
Gruss, Peter
Function showFormula(Row As Long, Col As Long, Optional Lcl As Boolean = True) As String
Application.Volatile
If Lcl Then
showFormula = Sheets(Application.Caller.Parent.Name).Cells(Row, Col).FormulaLocal
Else
showFormula = Sheets(Application.Caller.Parent.Name).Cells(Row, Col).Formula
End If
End Function
Public Function intSpaNr(strCol As String) As Integer
intSpaNr = Columns(strCol).Column
End Function