Maffegozer Posted July 2, 2010 Report Share Posted July 2, 2010 Hello,I've been working on a program for a few months.But I need the program to choose a random event from a list. And add it to the Listbox.But I can't figure out how to get it to choose a random one...What I've figured out (the easy part):'Here comes the random event part... Which i cant figure out...Dim Incident as IntegerSelect Case IncidentCase 0ListBox1.Items.Add("My item 1")Case 1ListBox1.Items.Add("This is my second item!")But I need about 30-50 events...Can anyone reach me a hand?Regards, Maffegozer.-EDIT-A friend of mine (Dion) told me to use this:Public Function Rand(ByVal Low As Long, _ ByVal High As Long) As Long Rand = Int((High - Low + 1) * Rnd) + LowEnd FunctionFiguring out now how to use the function in my Form_Load Link to comment Share on other sites More sharing options...
Maffegozer Posted July 4, 2010 Author Report Share Posted July 4, 2010 problem solved!Lock this topic please. Link to comment Share on other sites More sharing options...