ich stehe gerade bischen auf dem Schlauch.
Code: Alles auswählen
If addValue2 <> 0 then
geht er auf false.
ich bräuchte eine abfrage If addValue2 = leeres Feld
oder
If (Feld in E = leer ) thenn
addValue2 = osheet.getCellByPosition(iStartCol+1,iStartRow).value REM Spalte E auslesen. addValue2 (mom.HP)
das is die Abfrage vorher. hmm ich glaub ich poste mal alles
Code: Alles auswählen
Sub AddItNnow(event)
odoc=thisComponent
oSheet = oDoc.sheets(0)
oZelle = oDoc.getCurrentSelection()
iStartCol = oZelle.RangeAddress.StartColumn
iStartRow = oZelle.RangeAddress.StartRow
if iStartCol = 3 then
if iStartRow < 200 and iStartRow > 1 then rem Zeilen begrenzung
addValueMaxHp = osheet.getCellByPosition(iStartCol+2,iStartRow).value rem Spalte F auslesen. addValueMaxHp
addValue = osheet.getCellByPosition(iStartCol,iStartRow).value REM Spalte D auslesen. addValue Schaden
addValue2 = osheet.getCellByPosition(iStartCol+1,iStartRow).value REM Spalte E auslesen. addValue2 (mom.HP)
if addValueMaxHp = 0 then
osheet.getCellByPosition(iStartCol+2,iStartRow).string = "Max.HP" rem addValueMaxHp
osheet.getCellByPosition(iStartCol,iStartRow).string = ""
else
If addValue2 <> 0 then REM HIER BRÄUCHTE ICH NE ABFRAGE OB DAS FELD EINFACH LEER IST
osheet.getCellByPosition(iStartCol+1,iStartRow).value = addValue2-addValue
osheet.getCellByPosition(iStartCol+3,iStartRow).value = addValue
osheet.getCellByPosition(iStartCol,iStartRow).string = ""
else
osheet.getCellByPosition(iStartCol+1,iStartRow).value = addValueMaxHp-addValue
osheet.getCellByPosition(iStartCol+3,iStartRow).value = addValue
osheet.getCellByPosition(iStartCol,iStartRow).string = ""
end if
end if
end if
end if
end sub