I am using MS Excel as my datasource. I have one table in one of the workbook. When I retrieve the data from table I need column name as per MS Excel (e.g. A, B, C,… AA, AB… and so on.)
Is there any way to achieve it?
Please guide me.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Very easy
I made a method once for this, all you need is a column number and it will convert it to a string as “aa” or “bb”
This only works when your first column isn’t index = 0, but index = 1.
That is because the ‘A’ is not the same as a ‘0’ like in the normal numeral systems.
If it where then AB would be 0 * 26^1 + 1 * 26^0