You just found a bug in the macro (from investexcel.net isn't it), you can contact the author to tell him about this.
His method is using QueryTable to fetch the data from GoogleFinance, the result of this fetch is one column of data (at column A), he then use TextToColumn to split the data to multiple columns. Under normal circumstances, the content of each cell should be in string datatype (so the TextToColumn using comma as delimited character can be used), but this GAIL symbol is something unexpected. For the row(s) where the error occurred, the cell is in numeric datatype.
You can examine this by adding "Exit Sub" statement before the code reach TextToColumn job :
Now if you look at sheet "Data", for cell A150, A151, A215, A250, the datatype for these cells is numeric (they are right aligned), and if you change the number format to General for example, the format is ruined. This is not happened with other "normal" cells, because on these normal cells, there is mixed of commas and dots, so Excel automatically treats them as string (so can be splitted using TextToColumn using comma as delimiter), but for the failed cells, Excel assumes the comma(s) is just a thousand separator symbol (no comma at all), so the TextToColumn is failed.
And since it is not always the data is grouped in 3 digits format (for example the cell A250, there is one extra digit compared to other failed cells), we cannot manually fix the error.
-----------------------------------
Here I use another method to fetch the data using WinHTTPRequest object, the return is in string datatype (so no automatic data Conversion as occurred using QueryTable), and then split manually (not using TextToColumn feature). It seemed that the result is correct :
Bookmarks