Only allow specified strings in a range

  • Thread starter Thread starter Slick Willie
  • Start date Start date
S

Slick Willie

How could write a formula to only allow certain words or phrases in a
cell. I'm using the VLOOKUP function, and if a user enters a value
that is not in my table, the function returns #N/A. When I try to
test a cell with #N/A, I get a debug in VB, or another #N/A with Excel
formulas.
 
Also, to Check for an error

set cell = Range("B9")
' checks for any error
if iserror(Cell.Value) then

or
' checks specifically for #N/A
if Cell.Text = "#N/A" then

or
' checks specifically for #N/A
if cell.Value = cvErr(xlErrNA) then
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top