View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Lacoran Lacoran is offline
external usenet poster
 
Posts: 2
Default Excell Random number

I am using the rand() function in Visual basic to find a specific number on a
list and bring up the value from 2 cells over. I have got all that but the
list does not contain all number from 1 to 100. for example there is no 23
so when rand comes up with 23 the macro gets an error. is there a way in VB
that if it get that error it goes to the next integer 1 higher and
conditiunes that until it gets a number that works