View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_3_] Bob Phillips[_3_] is offline
external usenet poster
 
Posts: 2,420
Default Truncate a cell value

myVar = val(replace(Range("A2").value","_PF",""))

--
__________________________________
HTH

Bob

"Bishop" wrote in message
...
Say I have a cell with "_PF3" in it. I want to assign just the 3 to a
variable. How do I do that? All the cells I'm working with will be like
this: _PF23, _PF15, _PF8, etc. I want to assign just the number value in
the
cell without the _PF part.