Open Office Spreadsheet: sound alert when cell is positive - openoffice.org

I can colour a cell using conditional formatting.
But how can I set a sound alert when a cell has turned positive?
Thank you for your help.

Go to Tools -> Macros -> Organize Macros -> LibreOffice Basic and add the following code:
Sub ContentChanged (oCellChanged As Object)
oSheet = ThisComponent.Sheets(0)
oCell = oSheet.getCellRangeByName("A1")
If oCell.getValue() > 0 Then
Beep
End If
End Sub
Then go to sheet 1, right click on the tab and select Sheet Events. Set the Content changed event to point to the macro.
Now it will beep when cell A1 is greater than zero.

Related

Add data validation and Formulas in one cell

I am trying in google sheets to add a data validation where users can select ( Today, Incomplete) then if selected "Today" the cell will display today's date, and if "incomplete" then just display it as it is.
I did the formula
if(E2:2="Today",(TODAY()),"Incomplete")
But then add validation removes the formula if selected Today. Can someone help me, please.
Create a tab called 'DVs'
in A2 of that tab write "Incomplete".
in A3 of that tab, manually put today's date.
then point your Data Validation at those two cells.
then Tools>Script Editor.
then erase the code that is there that looks like this:
function myFunction(){
}
then paste this code.
function setToday(){
var date = new Date();
date.setHours(0,0,0,0);
SpreadsheetApp.getActive().getSheetByName('DVs').getRange('A3').setValue(date);
}
then Save.
Then click on the little alarm clock at the left to open the triggers.
Then at the bottom right, click on the button to add a trigger.
then choose the function, and set a "time driven" trigger that runs every day after midnight.
Then Save.
That should do it.

Google Sheets. Is it possible to give a word a value?

I want to give words number values.
Eg. Monthly =12, Quartly = 4
What are some ways I can do this?
Thanks.
you can use the Named Range feature to name a cell. They can be in another sheet even (not another document, another sheet in the same document)
Steps
In the menus Click Data and then Named ranges. A menu will open on the right.
In a cell type 12
Select the cell with 12 in it
Click "Add Range" on the right
Type Monthly for the name
Click Done
Repeat the steps 2 to 6 for Quarterly
Now in some other cell (even on another sheet in the same document) type =Monthly in a cell or =Quarterly or Use those names in formulas
See docs
Here's a screenshot. I created a sheet called constants and typed 12 and 4 in 2 cells. I've named the first cell Monthly and the 2nd cell Quarterly
Then in Sheet1 I can reference those names in forumla
or you can do it directly like:
=IF(A1 = "Monthly"; 12;
IF(A1 = "Quartly"; 4; ))

How do I format a cell, only when it's not empty, based on the input of another cell?

I'm working on a spreadsheet in Google Sheets for multiple people, and indicate in a column who the person the information on that row pertains to. I want to format cells on that column, only when they're not empty, based on what person is selected in another cell.
I can create functions to format things based on another cell's entry, but I don't know how to compound that with a function for not being empty. Sorry if this is super basic, I just can't figure it out.
Yep. This is a super simple thing to do.
1) Highlight the column where the person's name appears.
2) From the main menu, select Format, Conditional formatting.
3) In the sidebar click add a new rule. what you want to do is create one rule for each name that appears (or could appear) in that column.
4) Under "Format cells if, select "Text is exactly"
5) Type the name in the cell where it says Value or Formula
6) Choose a background colour to suit.
7) Click Done.
8) Repeat steps 3 to 7 for each person; but change the background colour in each case.
Here's an example.

Google Sheet button updates increases button textbox value

I'm pretty good at VBA but transitioning to Google Sheet scripting is killing me:
I have a drawing shape, with a textbox named
(by the end product there will be 6 text boxes, with identical actions)
I want to have a script which makes it so when I click the text box, the value increases by one.
I also have a reset textbox, which says reset, and when clicked, will set all 6 other textbox values to zero.
In excel, I had the following: subs for each shape which increased the textframe + 1, and a reset sub, but none of that language works in Google.
Please help.
I have also used VBA. Google currently has no equivalent to textframe. It has been requested. There are a number of like things you can try. The link below has a few examples. The first sheet (menu) has a menu named testing. It has four options. On open they will show multiple options. There are three named Button1, Button2, and Button3. Each shows a count. The count is set to 0 on open. If Button1 is clicked, A1 will be 1 and the testing menu will change to Button1 count=1. Clicking Button2 will change A2 to one and the testing menu will now show Botton1 count=1, Button2 count=1, Button3 count=0. The menu option Clear counts sets all button counts back to 0. Actually, the menu is replaced each time. The buttons tab has buttons that increase cell counts in total or separately.The button text does not change. I hope this gives you some ideas.
https://docs.google.com/spreadsheets/d/1ysr90k38hir-Kz8HTRY-vw6e7KFGJJWnNwlt2azzopk/edit?usp=sharing

How to dynamically set tab name in a formula?

I have a summary tab and multiple other tabs which are constructed the same way. I would like in my summary tab to gather information from all other tabs
Today, in the summary tab I have for each line:
first cell: My tab 1 -> name of a tab in the same spreadsheet
second cell: =COUNTIF('My tab 1'!$B7:$B; "OK") -> count of all cells with "OK" text in column B.
I would like to use the tab name defined in the first cell inside the formula of the second cell. Is it possible and, if yes, how?
Try the INDIRECT function, described here: https://support.google.com/docs/answer/3093377?hl=en
=INDIRECT($A$1)
In order to be seen as a reference for the range, INDIRECT needs the entire range reference as a single string, it seems. This gives you something like the answer to your question:
=COUNTIF(INDIRECT(CONCATENATE($A$1, "!$B7:$B")), "OK")
What you give up there is that the $B7:$B portion of your address is now a string, so if you copy this cell down the page, the 7 won't get updated to 8, 9, and so on.
There may be other combinations of functions that will get you closer: this is the one I arrived at with a few minutes of searching.
shorter solution:
=COUNTIF(INDIRECT($A$1&"!B7:B"), "OK")
and for dragging it would be:
=COUNTIF(INDIRECT($A$1&"!B"&ROW(B7)&":B"), "OK")

Resources