title: Generating numbers with certain probabilities visual basics vba
body: <p>I have some probabilities of </p>
  
  <p>26% 18% 26% 20% 10%</p>
  
  <p>and I want to generate some numbers (randomly in a certain range) based on the probability groups.</p>
  
  <p>I have done that previously with 2 probabilities of 80% and 20% like below: </p>
  
  <pre><code>If rnd*100 &lt; 80 then Output = 2 
  Else  output = 10
  End if
  </code></pre>
  
  <p>But I am not sure how to do that with more than 2 probabilities!</p>