[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [libreoffice-users] LibreOffice Calc - Date - increase number times...


David,

A follow up to my first reply. I wanted to investigate a bit more to see if
I could produce a macro that actually incremented values in column B based
on the corresponding cell in column D being changed.

This works for me incrementing the value in col B by +1 when the value in
column D on the same row is changed. Please note, it only works for the
first sheet of the workbook. I expect it could be made to work for the
current sheet but have not investigated how to do that. Changing the order
of the workbook tabs has no effect on which tab is recognized as the first
one. In addition to the reference I named in my first post the information
from this second reference was instrumental in making a macro that only
responded to changes in cells in column D.
https://docs.oracle.com/cd/E19064-01/so6/817-1826-10/817-1826-10.pdf pg. 119

and the macro...
Sub SheetChange(oEvent)

Dim rowNum, colNum as Integer
Dim oDoc, oSheet, oCell as Object

oDoc = StarDesktop.CurrentComponent
oSheet = oDoc.Sheets(0)

if oEvent.CellAddress.Column = 3 then
colNum = oEvent.CellAddress.Column
rowNum = oEvent.CellAddress.Row
oCell = oSheet.getCellByPosition(colNum - 2, rowNum)
oCell.Value = oCell.Value + 1
EndIf

End Sub

On Tue, Dec 10, 2019 at 11:50 PM zed <zed@zed.net.nz> wrote:

> Hi!
>
> Using LibreOffice v6.0.7.3 on Linux Mint v19.2 Mate
>
> I have a spreadsheeet in Calc which records data of reactions to a
> particular performer. It is in the form: It has Columns A - G.
>
> A - Name, fformatted as Text (records thre name of the persons doing the
> reaction)
> B - No, formatted number general (records number of times this
> reactors has reacted to the performer)
> C - First, formatted DD/MM/YY (records the first date the reactor reaacted
> to this performer)
> D - Last, formatted DD/MM.YY (records last date reactor reacted to this
> performer)
> E - Days, formatted =NOW()-D3 (records number of days since last reaction)
> F - Weeks, formatted =E3/7 (records number of weeks since last reaction)
> G - Months, formatted =F3/4 (records number of months since last reaction.
> reaction)
>
> Is there a formula that I can enter in Column B which will increase
> incrementally increase the figure by 1, please?
>
> Regards from New Zealand on a very warm summer evening.
>
> David
> --
> Zed
> "To use the term blind faith, is to use an adjective needlessly." Julian
> Ruck
>
> --
> To unsubscribe e-mail to: users+unsubscribe@global.libreoffice.org
> Problems?
> https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
> Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
> List archive: https://listarchives.libreoffice.org/global/users/
> Privacy Policy: https://www.documentfoundation.org/privacy
>
>

--
Alan Boba
CISSP, CCENT, ITIL v3 Foundations 2011

--
To unsubscribe e-mail to: users+unsubscribe@global.libreoffice.org
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy

Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.