von Karolus » Do, 16.03.2006 16:39
Hallo dkn
Versuchs mal damit
Function BUTOZI(formel As String)
Const DIGIT = "1234567890"
ReDim stack(1 To Len(formel) + 1)
Dim A, B, C As Variant , f As Single
Dim i As Integer, n as Integer, e as Integer
A = Array("A", "Ä", "a", "ä", "B", "b", "f", "F")
C = Array(1, 1, 1, 1, 2, 2, 2, 2)
For i = 7 To 0 Step -1
If Instr(1,formel, A(i),0) > 0 then
formel = Replace(formel, A(i), C(i))
n = n + 1
stack(n) = i
End If
Next
BUTOZI = (formel)
End Function
Function Replace( t as String, p as String, s as String) as String
Dim oFunktion as Object
Dim aArgumente(2) As String
' com.sun.star.sheet.FunctionAccess holen
oFunktion = createUnoService("com.sun.star.sheet.FunctionAccess")
aArgumente(0) = t
aArgumente(1) = p
aArgumente(2) = s
Replace = oFunktion.callFunction( "SUBSTITUTE", aArgumente() )
End Function
Anwenden mit
=BUTOZI(quellzelle)
Gruß
Karo
Hallo dkn
Versuchs mal damit
Function BUTOZI(formel As String)
Const DIGIT = "1234567890"
ReDim stack(1 To Len(formel) + 1)
Dim A, B, C As Variant , f As Single
Dim i As Integer, n as Integer, e as Integer
A = Array("A", "Ä", "a", "ä", "B", "b", "f", "F")
C = Array(1, 1, 1, 1, 2, 2, 2, 2)
For i = 7 To 0 Step -1
If Instr(1,formel, A(i),0) > 0 then
formel = Replace(formel, A(i), C(i))
n = n + 1
stack(n) = i
End If
Next
BUTOZI = (formel)
End Function
Function Replace( t as String, p as String, s as String) as String
Dim oFunktion as Object
Dim aArgumente(2) As String
' com.sun.star.sheet.FunctionAccess holen
oFunktion = createUnoService("com.sun.star.sheet.FunctionAccess")
aArgumente(0) = t
aArgumente(1) = p
aArgumente(2) = s
Replace = oFunktion.callFunction( "SUBSTITUTE", aArgumente() )
End Function
Anwenden mit
=BUTOZI(quellzelle)
Gruß
Karo