Did you declare ClassListRange as a variable, too?
if yes:
dim ClassListRange as Range
set classlistrange = worksheets("somesheetnamehere").range("classlistrange")
Readerresult = application.vlookup(userselection, Classlistrange,2)
if no:
Readerresult = application.vlookup(userselection, _
worksheets("somesheetnamehere").range("Classlistrange"),2)
And in either case, since you're matching on text values (names), I would think
you'd want an exact match.
Your formula should have 0 or False as the 4th argument.
Readerresult = application.vlookup(userselection, Classlistrange,2, false)
or
Readerresult = application.vlookup(userselection, _
worksheets("somesheetnamehere").range("Classlistrange"),2, 0)
Vlookup is returing an error.
My data table is very simple with 2 columns
Name Reader required ?
Bill yes
Carl no
Dave yes
etc..
This data table is called Classlistrange
The spreadsheet expression does as I expect; for example
=Vlookup("Bill",Classlistrange,2) returns yes
The VB code fails the iserror(Readerresult) test
Readerresult = application.vlookup(userselection, Classlistrange,2)
where userselection contains the string "Bill"
Hope you can help with this !