Hello everyone.
My version of LibreOffice is 7.0.0.3 and I am on a Mac OSX Mojave (10.14)
And I have this code here which copies a value from A1 in Sheet1, pastes it into B2 in Sheet2, and gives a MsgBox depending on whether the value is strictly greater than 100, strictly less than 100, or equal to 100:
Sub MsgBoxEtCopieDuneCelluleVersDeuxiemeFeuilSixiemeTeste
Sheet1 = ThisComponent.Sheets.getByIndex(0)
Sheet2 = ThisComponent.Sheets.getByIndex(1)
RangeOrg = Sheet1.getCellRangeByName("A1").RangeAddress
RangeCpy = Sheet2.getCellRangeByName("C5").RangeAddress
CellCpy = Sheet2.getCellByPosition(RangeCpy.StartColumn,_
RangeCpy.StartRow).CellAddress
Sheet1.CopyRange(CellCpy, RangeOrg)
If Sheet2.getCellRangeByName("C5").Value > 100 Then
MsgBox "YES"
ElseIf Sheet2.getCellRangeByName("C5").Value < 100 Then
MsgBox "NOOOOOOO"
Else
MsgBox "Equal to 100"
End If
End Sub
And I want to know how I can sum two cells from Sheet1 and paste that sum into C5 of Sheet2
(so for example: 8 from Sheet1,A1, and 16 from Sheet1,B1).
I have tried to look a bit for a way to Sum in LO Basic, but I have not been successful.
Would any of you know how to do this?