View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default How to deal with "$0 - $500" in one cell

v = application.Split(cell.Value,"-")
lb = clng(trim(v(0))
ub = clng(trim(v(1))
if v = lb and v <= ub then
' it's between

--
Regards,
Tom Ogilvy


"Who I Am" wrote:

A spreadsheet has multiple cells filled with the ranges like "$0 -
$500" or "$501 - $1000" or "Jan 2006 - March 2006".

Is there a way to make judgement programmatically (either using
function or procedure) to determine if a value falls in the range?

Thanks in advance.