View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Chris Chris is offline
external usenet poster
 
Posts: 12
Default Problems with substitute

Hi all...

I import some data into a worksheet column but instead of a number I get and
error saying values may have an apostophe preceding the value and it is not
seen as a number. I have the formula below which works within the sheet but
want to automate it in VBA for the whole column:

=IF(RIGHT(B2,1)="'",SUBSTITUTE(B2,"'",)*-1,B2)

I cannot work this out and I can't find a way to convert the imported value
to a number.

Would really appreciate some help on this...thx