Hallo, Wolfgang Jäth schrieb: > Sollten die Variablen 'D1' und 'K1' nicht besser ebenfalls > übergeben ...
Na klar, Du hast ganz Recht ... da war ich völlig neben der Spur. Also nochmal: Function FOO_X(x, y, d, k) If x < y Then tmp = x ElseIf y < x Then tmp = y Else tmp = x End If FOO_X = d*24*k*tmp End Function und in Tabellenzelle aufrufen mit: =FOO_X(J1;$D$4;D1;K1) Function FOO_XX(x, y, d, k) oFunctionAccess = createUnoService("com.sun.star.sheet.FunctionAccess") Dim args(1) As Variant args(0) = x args(1) = y result = oFunctionAccess.callFunction("Min", args()) FOO_XX = d*24*k*result End Function und in Tabellenzelle aufrufen mit: =FOO_XX(J1;$D$4;D1;K1) Function FOO_XXX() oFunctionAccess = createUnoService("com.sun.star.sheet.FunctionAccess") Dim args(1) As Variant With ThisComponent.Sheets(0) args(0) = .getCellRangeByName("J1").Value args(1) = .getCellRangeByName("D4").Value result = oFunctionAccess.callFunction("Min", args()) FOO_XXX = (.getCellRangeByName("D1").Value)*24*(.getCellRangeByName("K1").Value)*r esult End With End Function und in Tabellenzelle aufrufen mit: =FOO_XXX() Gruß Jörg --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@de.openoffice.org For additional commands, e-mail: users-h...@de.openoffice.org