View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
H.G. Lamy H.G. Lamy is offline
external usenet poster
 
Posts: 48
Default RefEdit in UDF ?

Thank you for the correction, Chip!

hgl

"Chip Pearson" wrote in message
...

The line that generates the random index is bad. Change

N = Int(N) * Rnd + 1

To

N = ((Int(R.Cells.Count) - 1) * Rnd) + 1

Cordially,
Chip Pearson
Microsoft MVP 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com
[email on web site]




On Tue, 2 Feb 2010 19:26:47 -0800 (PST), Greg Glynn
wrote:

This kind-of works and kind-of doesn't.

I have an 8 element test array and the code regularly generates 9 as
its random index number.

Greg