View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Rosenfeld[_2_] Ron Rosenfeld[_2_] is offline
external usenet poster
 
Posts: 1,045
Default Function to convert CUSIP code to ISIN code cusipconv()

On Wed, 6 Mar 2013 18:01:45 +0000, Amir Kheirollah wrote:


I have the following code (Function: cusipconv) to convert CUSIP code to
ISIN. Some people used it before and reported satisfactory results. In
my case the function turns out 0 and not ISIN code. Can someone kindly
look into the function to see what is the problem. I provide here with
CUSIP code for 5 companies that you can use to test the function.

CUSIP
00371F206
04543P100
00081T108
002564102
000957100

Many thanks.



If Len(st) < 11 Or Mid(st, 1, 1) < "A" Or Mid(st, 1, 1) "Z" Then Exit Function

Since none of your codes have 11 characters, the function will exit at this line. Even if they had 11 characters, they would all fail the next test since they all start with "0" and "0" < "A"