[SOLVED] Create button to return random name

Discuss the spreadsheet application

[SOLVED] Create button to return random name

Postby OfficeNewbie » Sat May 25, 2019 7:46 am

Hey y'all, I am a COMPLETE NUB at Office of any kind, and I would be greatly appreciative if somebody could guide me through, with SIMPLE instructions (I am a simple man), creating a button... formula? maybe.

So to describe what I want to do:

I want to create a random DnD name generator that, at the press of a button on Sheet 1, will take two names from two different collumns (first name last name) on sheet 2 and combine them in adjoining cells on sheet 1.

https://photos.google.com/photo/AF1QipNbsGmshrHfX2dEJG0GCMTEW_85t4b_ZAgx7Sjj

I apologise if that image doesn't show up, i don't know how code works.

So that is Sheet2. What I'd like is to create buttons on sheet1 titled, like "Dragonborn Female" which will take a random name from the corresponding column (There are 50 name rows in each column), combine it with a name from the 'Clan' Column and present it in front of the button on sheet 1. It would be good to be able to hit the button again and refresh the choice. Then I need to do that for every column, but i guess explaining how to create one of these... macros? Formulas? just once will allow me to create it for every column.

Also, if this is in a tutorial or already been answered somewhere and you could point me in the right direction, that would be awesome.

Looking forward to hearing from somebody who can help this Office n00b with a passion project :)

Title Edited. A descriptive title for posts helps others who are searching for solutions and increases the chances of a reply [robleyd, Moderator].. Was Complete Noob looking for help.
Last edited by robleyd on Wed May 29, 2019 2:18 am, edited 2 times in total.
Reason: Add green tick
OfficeNewbie
 
Posts: 3
Joined: Sat May 25, 2019 2:25 am

Re: Create button to return random name

Postby Villeroy » Sat May 25, 2019 3:25 pm

OfficeNewbie wrote:Hey y'all, I am a COMPLETE NUB at Office of any kind, and I would be greatly appreciative if somebody could guide me through, with SIMPLE instructions (I am a simple man), creating a button...

There are no simple solutions for simple men.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04, no OpenOffice, LibreOffice 6.x
User avatar
Villeroy
Volunteer
 
Posts: 26751
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Create button to return random name

Postby FJCC » Sat May 25, 2019 5:29 pm

Doing this with a button would require a macro and that requires a lot of learning. The disadvantage of a formula is that it will be recalculated every time the sheet is recalculated, changing the names. I assume you do not want that. If you could post an actual document, someone might have a concrete suggestion. To post a file, click Post Reply and look for the Upload Attachment tab just below the box where you type a response.
Windows 10 and Linux Mint, since 2017
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
FJCC
Moderator
 
Posts: 7157
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Create button to return random name

Postby Villeroy » Sat May 25, 2019 10:18 pm

=INDEX(range;RANDBETWEEN(1;ROWS(range))
Recalculates when range changes or with Ctrl+Shift+F9
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04, no OpenOffice, LibreOffice 6.x
User avatar
Villeroy
Volunteer
 
Posts: 26751
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Create button to return random name

Postby OfficeNewbie » Sun May 26, 2019 3:35 am

Posting File as requested. I'm realising that I am basically asking someone to spend a chunk of their time to help a complete stranger for no real reward other than that thrill of dopamine your brain creates when you do something generous. I have alot of respect for you guys, so thanks very much.
Attachments
NPC Gen.ods
Names are on Sheet2
(24.01 KiB) Downloaded 19 times
OpenOffice 3.1 on Windows 10
OfficeNewbie
 
Posts: 3
Joined: Sat May 25, 2019 2:25 am

Re: Create button to return random name

Postby FJCC » Sun May 26, 2019 4:32 am

Here is an example based on Villeroy's suggestion.
Attachments
NPC_Gen_FJCC.ods
(26.54 KiB) Downloaded 21 times
Windows 10 and Linux Mint, since 2017
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
FJCC
Moderator
 
Posts: 7157
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Create button to return random name

Postby Villeroy » Sun May 26, 2019 9:02 pm

FJCC wrote:Doing this with a button would require a macro and that requires a lot of learning.

Nope. Nevertheless more learning that a simple man is willing to do.
Attachments
NPC_Gen_FJCC-2.ods
(28.06 KiB) Downloaded 19 times
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04, no OpenOffice, LibreOffice 6.x
User avatar
Villeroy
Volunteer
 
Posts: 26751
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Create button to return random name

Postby OfficeNewbie » Tue May 28, 2019 4:04 pm

Hey guys! So sorry for not replying sooner, I've been crazy busy at work.

Completely and utterly solved! I was able to take the example line and reproduce it for all of the Name columns. Hey, Ctrl+Shift+F9 works just as well as a button for me. Thank you so very much!
OpenOffice 3.1 on Windows 10
OfficeNewbie
 
Posts: 3
Joined: Sat May 25, 2019 2:25 am


Return to Calc

Who is online

Users browsing this forum: No registered users and 36 guests