2

I am doing a query against a range in Excel to pull records. I need 5 records selected in random from a pool of 15. I did some research and could find a syntax for random ordering in MySQL and T-SQL. Here is a question from SO that summarizes these examples: Return rows in random order

SELECT * FROM table ORDER BY NEWID() - from T-SQL

Is there a similar NEWID() or UUID() syntax available in Excel VBA, and if not, what is an elegant solution to achieve this?

Community
  • 1
  • 1
ulmas
  • 2,203
  • 16
  • 22

1 Answers1

0

I think you are looking for this: http://www.tushar-mehta.com/excel/newsgroups/rand_selection/index.html#rand_and_rank

Tomas Greif
  • 21,685
  • 23
  • 106
  • 155