Jul-22-2020, 06:06 PM
Hello,
I don't really understand the def() function so I'm not really sure what I need to put at line def. Right now nothing is printing out when I run this portion of the script. If I remove def and return the script fines my string but I need it to return a different cell once it finds my string so that's why I added in def and return.
I don't really understand the def() function so I'm not really sure what I need to put at line def. Right now nothing is printing out when I run this portion of the script. If I remove def and return the script fines my string but I need it to return a different cell once it finds my string so that's why I added in def and return.
TFile = xl.load_workbook(T) Sheet = TFile.worksheets[0] String=pd.read_excel(input_file, usecols="A",nrows=1,header=None,squeeze=True).str.slice(start=28,stop=-2).to_string(index=False).strip() def TA(String): for cellObj in Sheet['B2:B10000']: for obj in cellObj: if (obj.value) == String: return obj.offset(column=2, row=6).value TA = obj.offset print(TA)