[Solved] Use button to increment a cell

Discuss the spreadsheet application
Locked
Dupakos
Posts: 2
Joined: Thu May 30, 2024 10:49 am

[Solved] Use button to increment a cell

Post by Dupakos »

Hello I am a beginner
I want to add a button on a spreadsheet
so that when I push it to add 1 to the number in cell A2
(if the value of A2 was 7 to become 8)
could someone tell me how to do it?
But step by step please because I am a beginner.
Lots of thanks :)
Maria Dupakos
Last edited by MrProgrammer on Fri Jun 07, 2024 3:06 pm, edited 1 time in total.
Reason: Tagged ✓ [Solved] Samples provided -- MrProgrammer, forum moderator
OpenOffice 4.1
User avatar
robleyd
Moderator
Posts: 5505
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: How to add a button on a spreadsheet ?

Post by robleyd »

There is a sample spreadsheet in the last post of this topic which may do what you want.

Alternatively some of these pages may be helpful.
Slackware 15 (current) 64 bit
Apache OpenOffice 4.1.16
LibreOffice 26.2.3.2; SlackBuild for 26.2.3 by Eric Hameleers
---------------
I hate this damn computer, I wish that I could sell it.
It won't do what I want it to, Only what I tell it.
Dupakos
Posts: 2
Joined: Thu May 30, 2024 10:49 am

Re: How to add a button on a spreadsheet ?

Post by Dupakos »

Sorry but not understand :(
What are all these codes ?
told ya am beginner !!!!
OpenOffice 4.1
User avatar
Lupp
Volunteer
Posts: 3756
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: How to add a button on a spreadsheet ?

Post by Lupp »

Beginners should probably begin at the beginning.
The insertion and usage of a FormControl (SpinButton in this case?) aren't at that point.
And community forums will possibly not offer personalised introduction starting at any preferred point..
Sorry! Can't change that.

An example file containg a few images related to SpinButton objects was too large to be uploaded here.

=== Editing ===
I found the time to make an example for you containing a few explanations in place of the images:
ask111586_BeginnersQuestion_QM.ods
(14.8 KiB) Downloaded 86 times
As a beginner you should consider to shift to LibreOffice.
It is from a different branch also going back to OO.o, but being much more vital now.
A later, then possibly needed change to LibO would require to adapt to a slightly changed appearance and user interface, and to change some habits adapted to AOO.
On Windows 10: LibreOffice 25.8.4 and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
User avatar
MrProgrammer
Moderator
Posts: 5430
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: Add button to increment a cell

Post by MrProgrammer »

Dupakos wrote: Thu May 30, 2024 11:10 am Hello I am a beginner. I want to add a button on a spreadsheet.
As a spreadsheet beginner you probably don't know that buttons are not one of their features. Many spreadsheets, including Calc, allow advanced users to perform programming. It is possible to create buttons with programming. But spreadsheet programming is not for beginners. If you are a beginner you cannot not use buttons.
[Tutorial] Ten concepts that every Calc user should know

Dupakos wrote: Thu May 30, 2024 11:10 am … when I push [a button] to add 1 to the number in cell A2
If you want to investigate further, we do have some topics which discuss using a recorded macro to increment cells. You do not need to know any programming to create a recorded macro, but you will need to understand Calc's standard user interface. Though it is quite complicated to create a button, it is less complicated to use a function key or a toolbar to run the macro, but perhaps still complicated for a beginner.
[Solved] Increment/decrement feature for cells
[Solved] How do I increase all variables by 1 with a click?

If this solved your problem please go to your first post use the Edit button and add [Solved] to the start of the Subject field. Select the green checkmark icon at the same time.
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.7.8, iMac Intel.   The locale for any menus or Calc formulas in my posts is English (USA).
Locked