corsasport.co.uk
 

Corsa Sport » Message Board » Off Day » Geek Day » Need someone with a little Excel knowledge


New Topic

New Poll
  Subscribe | Add to Favourites

You are not logged in and may not post or reply to messages. Please log in or create a new account or mail us about fixing an existing one - register@corsasport.co.uk

There are also many more features available when you are logged in such as private messages, buddy list, location services, post search and more.


Author Need someone with a little Excel knowledge
AdZ9
Member

Registered: 14th Apr 06
User status: Offline
24th Jun 09 at 09:51   View User's Profile U2U Member Reply With Quote

Yo

Basically I need someone that knows a little bit on Excel as i'm guessing this is quite easy for someone who knows how!

I have two lists of names, both lists have 26 names in it.
Basically I want to put both lists into excel, and have a button or another cell that somehow random picks one name from one list and one from another and puts them together in a cell to create a new name so to speak.

Does anyone have an idea on how I can do it, or the code I use to get it to work?

Cheers,
Adam

Dom
Member

Registered: 13th Sep 03
User status: Offline
24th Jun 09 at 15:40   View User's Profile U2U Member Reply With Quote

Are you storing both forenames and surnames in these two lists? How do you want the final data to be? eg: if it picks 'Frank' and 'Bob', do you want to be 'Frank Bob'?
Would you want the data placed in another cell or could it just alert you (using a message box etc)?

Eitherway you could do it using VB Macro's, would be fairly simple

edit - http://it.toolbox.com/wiki/index.php/Basics_of_Excel_VBA:_Cell_Navigation , lists the standard VBA to select cells and get the data (looks at 'Using Variables').

Something like below will grab the data -

Range("A" + Int ((26 - 1 + 1) * Rnd + 1)).Select
strName1 = ActiveCell.Value
Range("B" + Int ((26 - 1 + 1) * Rnd + 1)).Select
strName2 = ActiveCell.Value

Then you can dump the data to a message box (ie: popup alert box) like so -

MsgBox(strName1 & chr(13) & strName2)

All of that on a button should churn something out (all of the top of my head), although you might have to open the workbook and sheet first.

[Edited on 24-06-2009 by Dom]
blebo
Member

Registered: 18th Apr 02
User status: Offline
24th Jun 09 at 15:54   View User's Profile U2U Member Reply With Quote

In coluum A list numbers 1 - 26
In coluum B all Forenames in a lst
In coluum C list numbers 1 - 26
In coluum D all Forenames in a lst

Then in any other cell

Paste =CONCATENATE(VLOOKUP(ROUND(RAND()*6,0),A:B,2,0)," ",(VLOOKUP(ROUND(RAND()*6,0),C,2,0)))
Ian
Site Administrator

Avatar

Registered: 28th Aug 99
Location: Liverpool
User status: Offline
24th Jun 09 at 20:30   View Garage View User's Profile U2U Member Reply With Quote

You could also use CHOOSE()

=CHOOSE(RANDBETWEEN(1,26),"Alf", "Bob", "Carl", "Dave" ... "Zak")

 
New Topic

New Poll

  Related Threads Author Forum Replies Views Last Post
Help needed again ...Trotty can you help Red_Corsa Geek Day 17 1679
21st Mar 03 at 00:15
by Red_Corsa
 
is there a program that...... chris_uk Geek Day 6 1904
16th Jun 05 at 00:47
by Dan B
 
Microsoft Excel Kathryn W Geek Day 7 1280
3rd Aug 07 at 12:12
by RyanSxi
 
Excel Help AndyKent Geek Day 3 1461
6th Oct 07 at 10:22
by aPk
 
need an excel like programme (for free) Shane Geek Day 12 1777
13th May 08 at 14:55
by pow
 

Corsa Sport » Message Board » Off Day » Geek Day » Need someone with a little Excel knowledge 28 database queries in 0.0122340 seconds