Hi, in my quest to confuse things I’ve been looking at finding the adjacent cell in an excel file when a cell in the relative cell is found(eventually looking to fill in text boxes based on a drop down). What code i have works if the data in column D is a string if its an integer i get the error
the code snippet is
###Check status of variable#####
cells = (str(cellsOfFoundRow[3].value))
if type(cells) == str:
print("It's a string")
print(cellsOfFoundRow[3].value)
else :
print("Not a string")
print(cellsOfFoundRow[3].value)
##############################
#for debugging purposes
input("stop here to check values")
if cellsOfFoundRow:
print("Found:{}, the value of Column D is {}"
.format(" ".join([cell.value for cell in cellsOfFoundRow]),
cellsOfFoundRow[3].value))
the error seems to be in the part cellsOfFoundRow[3].value), i’ve tried casting it as a string in the format section and also before where i tried to create the variable cells and put the variable in place of cellsOfFoundRow[3].value) but still get the same error, is there anyway i can make this a string so that it’ll work
any guidance is appreciated
thanks