I'm using python to automate the process of creating multiple name tags using an excel sheet list.
My problem is that I need to take the 'name' column and 'enterprise' column values and put them in a single cell of a new document.
Like this:
To this:
Right now I'm using openpyxl and although I manage to transfer one of the columns I can't do it with both. The code below was one of the things that I've tried.
import openpyxl as xl
e = xl.load_workbook('etiquetas.xlsx')
eplan = e['Planilha1']
c = xl.load_workbook('Crachá Relação 15.10.19.xlsx')
cplan = c['Plan1']
maxlinhas = cplan.max_row
for i in range (2, maxlinhas+1):
nome = cplan.cell(row = i, column = 1).value
preenchernome = eplan.cell(row = i-1, column = 1)
empresa = cplan.cell(row=i, column=2).value
preencherempresa = eplan.cell(row=i - 1, column=1)
preenchernome.value = nome, empresa
e.save('teste.xlsx')
But this code returns the following error:
ValueError: Cannot convert ('Gladisson Garcia Westphal', 'Agro Divel') to Excel

