Hi everyone,
As part of the cleanup portion of a larger macro I'm creating, I need to add a 3 letter extension to an ID number for a stock. The problem I have is that the 3 letter extension is different depending on which exchange around the world the stock is traded on. The way the spreadsheet is setup, column A would be the exchange and column B the ID number. I originally thought of doing an IF statement that would go loop through the spreadsheet something like...
If column A = "toronto" then add .tor to column B
Else If A = "Paris" then add .par to column B
and so on. I know the code to add the extension to column B, my problem is that I have a list of about 25 exchanges. Since Excel limits me to only 7 nested IF's, I'm obviously over my limit. The spreadsheet would have up anywhere from 500 to about 2000 securities on it, so to have it loop through multiple times with each loop having 7 IF statements, would slow it down considerably. Would anyone have any suggestions as to an alternate plan of attack?
As part of the cleanup portion of a larger macro I'm creating, I need to add a 3 letter extension to an ID number for a stock. The problem I have is that the 3 letter extension is different depending on which exchange around the world the stock is traded on. The way the spreadsheet is setup, column A would be the exchange and column B the ID number. I originally thought of doing an IF statement that would go loop through the spreadsheet something like...
If column A = "toronto" then add .tor to column B
Else If A = "Paris" then add .par to column B
and so on. I know the code to add the extension to column B, my problem is that I have a list of about 25 exchanges. Since Excel limits me to only 7 nested IF's, I'm obviously over my limit. The spreadsheet would have up anywhere from 500 to about 2000 securities on it, so to have it loop through multiple times with each loop having 7 IF statements, would slow it down considerably. Would anyone have any suggestions as to an alternate plan of attack?