Oct-03-2019, 10:03 PM
(This post was last modified: Oct-03-2019, 10:05 PM by curranjohn46.)
Hi,
I am using openpyxl to find and print values in a column of a spreadsheet. and then want to search for those values in a second spreadsheet, and format the row (color it orange to be exact). I need help on understanding how to search for the the printed values in the second spreadsheet.
Here is how I get the values:
141680
469897
48670
281174
I then want to search another spreadsheet for those values. Can I somehow output those above numbers (instead of print?) in a manner where I can then iterate through rows in the second spreadsheet and find each one? Then I will figure out the color formatting which I know how to do. Any thoughts or hints appreciated. I am new at this and feeling stuck.
Thanks in advance!
I am using openpyxl to find and print values in a column of a spreadsheet. and then want to search for those values in a second spreadsheet, and format the row (color it orange to be exact). I need help on understanding how to search for the the printed values in the second spreadsheet.
Here is how I get the values:
from openpyxl import load_workbook IntLiveFile = "C:\\Users\\Jcurran\\weeklylive.xlsx" wb=load_workbook(IntLiveFile) wb.sheetnames ws = wb.active #Extracts the subscriber number for accounts that went live last week. for row in ws.iter_rows("L"): for cell in row: if cell.value == 'Integration Live': print(ws.cell(row=cell.row, column=3).value)#above code gives me desired output from spreadsheet:
141680
469897
48670
281174
I then want to search another spreadsheet for those values. Can I somehow output those above numbers (instead of print?) in a manner where I can then iterate through rows in the second spreadsheet and find each one? Then I will figure out the color formatting which I know how to do. Any thoughts or hints appreciated. I am new at this and feeling stuck.
Thanks in advance!