Hallo zusammen.
Ich habe eine quadratische Tabelle, bei der in jeder Zelle eine Ziffer stehen soll. Dies will ich prüfen. Jeder Zelleninhalt wird mit
oZelle = oBlatt.getCellByPosition(iI,iJ)
sTmp = oZelle.String
gelesen und mit
iErg = inStr(sZchn,sTmp)
If iErg = 0 Then
auf Ziffer geprüft. Dies funktioniert gut, wenn der zu untersuchende Zelleninhalt ein unzulässiges Zeichen ist, das Ergebnis ist 0. Aber wehe, wenn in der zu untersuchenden Zelle garnicts ist, also "". Dann steht in iErg eine 1,??? und in sTmp ein "". Gut ich habe eine Lösung gefunden mit
If iErg = 0 OR sTmp = "" Then
iMk = 0
Exit For
End If
Wo kommt denn die 1 her? If iErg = 0 OR sTmp = "" Then
iMk = 0
Exit For
End If
Mit freundlichen Grüßen
Günter
Ach so: LinuxMint 15 Kernel 3.8.0-19 LO 4.1.0.4 Build ID:410m0(Build:4)
iMk = 1
Url = "private:factory/scalc"
Desktop = CreateUnoService("com.su.star.frame.Desktop")
oTabDok = ThisComponent
oBlatt = oTabDok.getCurrentController().getActiveSheet()
oBlatt = oTabDok.getCurrentController().ActiveSheet
sZchn = "123456789"
For iJ = 4 To 12
For iI = 24 To 32
oZelle = oBlatt.getCellByPosition(iI,iJ)
sTmp = oZelle.String
iErg = inStr(sZchn,sTmp)
If iErg = 0 OR sTmp = "" Then
iMk = 0
Exit For
End If
Next iI
If iMk = 0 Then
Exit For
End If
Next iJ
If iMk = 1 Then