[Solved] Counting the user INPUTS?

Discuss the spreadsheet application
Post Reply
keenkeem
Posts: 20
Joined: Fri Nov 06, 2015 12:09 pm

[Solved] Counting the user INPUTS?

Post by keenkeem »

is there a way to count the number of times a user filled-up a certain cell???
Last edited by Hagar Delest on Mon Nov 23, 2015 11:24 pm, edited 1 time in total.
Reason: tagged [Solved].
OPENOFFICE 4.1.2
User avatar
Villeroy
Volunteer
Posts: 31348
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: counting the user INPUTS?

Post by Villeroy »

Right-click sheet, Sheet Events, Content changed...
Insert blank sheet behind the current one where all changes of all cells are counted in the corresponding cell.

Code: Select all

Sub Sheet1_Changed(e)
'globalscope.basiclibraries.loadlibrary("MRILib")
'MRI e
a = e.getCellAddress()
REM write to next sheet
c = ThisComponent.Sheets(a.Sheet +1).getCellByPosition(a.Column, a.Row) 
c.setValue(c.getValue()+1)
End Sub
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
keenkeem
Posts: 20
Joined: Fri Nov 06, 2015 12:09 pm

Re: counting the user INPUTS?

Post by keenkeem »

Sir thanks for your reply. I appreciate it. Last one question, what if you want to count only the number of times a user INPUTS a certain value. like number of times a user inputs yes in a "yes or no" question? (the user inputs X number of Yes out of 10 question something like that, kobe bryants shots 5 out of 10 shots...)
OPENOFFICE 4.1.2
arrowman
Posts: 8
Joined: Mon Nov 21, 2011 12:01 pm

Re: counting the user INPUTS?

Post by arrowman »

Villeroy wrote:Right-click sheet, Sheet Events, Content changed...
(...)
Is this possible to define this event in Basic Macro?
OpenOffice 3.2.1, Windows XP/Vista
User avatar
Lupp
Volunteer
Posts: 3710
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: [Solved] Counting the user INPUTS?

Post by Lupp »

arrowman wrote:Is this possible to define this event in Basic Macro?
What use? The assignment of a Sub to a sheet event is saved with the document. Once done the setting will persist. No need for a second "macro".

(See also: https://ask.libreoffice.org/en/question ... y-a-macro/.)
On Windows 10: LibreOffice 25.2.4 and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
Post Reply