View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default checking numbers in VBA

Ian,

Isnumeric returns TRUE for a blank cell so try

MsgBox Range("A1").Value < "" And IsNumeric(Range("A1").Value)

Which would return TRUE for a number


Mike

"Ian" wrote:

how do I check if a variable is numeric in VBA for Excel, I've tried various
combinations such as Isnu, Is Numeric etc but nothing seems to work unless
I have my syntax wrong