#! python3 # encoding: UTF-8 import openpyxl,os from openpyxl.utils import get_column_letter os.chdir('C:\\Users\\Administrator\\Python35-32') wb = openpyxl.load_workbook('TxttoExcel.xlsx') sheet = wb.get_active_sheet() for n in range(1,sheet.max_column): file = open(str(n)+'.txt','w', encoding='utf-8') print(len(sheet.rows)) for m in range(1,sheet.max_row): file.write(str(sheet.cell(row=m, column=n).value))