# Solved Matching a winning ticket number with the purchaser's name

September 21, 2012 at 21:25:14
Specs: Windows Vista
 Hi-I volunteer for a non-profit dog rescue and we will be holding a raffle to raise money. I would like to enter a buyer's name, email, etc and their first and last ticket number (they like getting lots of tickets so I would like to just record the first and last ticket numbers). Was hoping someone might have, or would be able to help us by writing a macro where we could enter the winning number and then have the macro stop when it met two conditions -- the winning number is equal to or greater than the first number in the range and less than or equal to the last number in the range. If this is possible I am sure many other rescues would find this helpful and I would share it with my counterparts throught the country.I hope this is doable and someone is willing to help us, it would allow us to spend less time plugging in data and more time saving dogs. We and our orphans would be very grateful. We'll even put a thankyou on our Facebook Page or website www.akitas.org.Thanks so muchBarbara

See More: Matching a winning ticket number with the purchasers name

#1
September 22, 2012 at 02:09:24
 Have you considered the VLOOKUP function with a range_lookup argument of 1?That way all you would need to enter is the first number of the buyer's sequence.Read up on VLOOKUP in the Excel help files to see how the range_lookup argument works.With the ticket numbers in Column A, sorted ascending, this formula will return Rover if C2 contains any number from 246 though 368:=VLOOKUP(C2,\$A\$2:\$B\$4,2,1)``` A B C D 1 Ticket Name Win # Winner 2 123 Fluffy 257 =VLOOKUP(C2,\$A\$2:\$B\$4,2,1) 3 246 Rover 4 369 Rusty ```Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.