InBlock.gif
InBlock.gif                 /// <summary>
InBlock.gif                 /// 10进制到Excel的26进制的转换函数
InBlock.gif                 /// </summary>
InBlock.gif                 /// <param name="i"></param>
InBlock.gif                 /// <returns></returns>
InBlock.gif                 private string convertToCharacter( int i)
InBlock.gif                {
InBlock.gif                         char[] list = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".ToCharArray();
InBlock.gif                        StringBuilder sb = new StringBuilder();
InBlock.gif                         while ((i - 1) / 26 != 0)
InBlock.gif                        {
InBlock.gif                                sb.Append(list[i / 26 - 1]);
InBlock.gif                                i = i % 26;
InBlock.gif                        }
InBlock.gif                        i = (i - 1) % 26;
InBlock.gif                        sb.Append(list[i]);
InBlock.gif                         return sb.ToString();
InBlock.gif                }
转载于 http://www.cnblogs.com/tionase/archive/2008/02/16/1070289.html