I was wondering if anybody knew how to iterate through letters in excel with python using the module xlsxwriter. I want to put thing A every 1st, 4th, and 7th column and so forth. Thing B every 2nd, 5th, and 8th column. Thing C at every 3rd, 6th, 9th column. Each row down will have different values. That is the best way I can describe it.
import xlsxwriter
workbook = xlsxwriter.Workbook('myfile.xlsx')
worksheet = workbook.add_worksheet()
x = 1
worksheet.write('A1', 'The value of A goes here')
worksheet.write('B1', 'The value of B goes here')
worksheet.write('C1', 'The value of C goes here')
for row in data:
worksheet.write('A' + str(x), valueA)
worksheet.write('B' + str(x), valueB)
worksheet.write('C' + str(x), valueC)
x += 1
workbook.close()
Just imagine each row has its own set inside data, and value A B C changes for each increment of x.
How do I put my value A at A, D, G... value B at B,E,H... value C at every C, F, I ... and so forth? I'm not sure how to iterate through that :( Can somebody help?