[SOLVED] Create button to return random name

Discuss the spreadsheet application
Post Reply
OfficeNewbie
Posts: 3
Joined: Sat May 25, 2019 2:25 am

[SOLVED] Create button to return random name

Post by OfficeNewbie »

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/AF1QipN ... b_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
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Create button to return random name

Post by Villeroy »

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 with LibreOffice 6.0, latest OpenOffice and LibreOffice
FJCC
Moderator
Posts: 9248
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Create button to return random name

Post by FJCC »

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.
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Create button to return random name

Post by Villeroy »

=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 with LibreOffice 6.0, latest OpenOffice and LibreOffice
OfficeNewbie
Posts: 3
Joined: Sat May 25, 2019 2:25 am

Re: Create button to return random name

Post by OfficeNewbie »

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 120 times
OpenOffice 3.1 on Windows 10
FJCC
Moderator
Posts: 9248
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Create button to return random name

Post by FJCC »

Here is an example based on Villeroy's suggestion.
Attachments
NPC_Gen_FJCC.ods
(26.54 KiB) Downloaded 112 times
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Create button to return random name

Post by Villeroy »

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 100 times
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
OfficeNewbie
Posts: 3
Joined: Sat May 25, 2019 2:25 am

Re: Create button to return random name

Post by OfficeNewbie »

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
Post Reply