from openpyxl import load_workbook
wb = load_workbook(filename=r'C:\Users\Hp\Desktop\Test data.xlsx' )
ws = wb['Sheet1']
range=ws['B2':'B10']
for cell in range:
for x in cell:
y=x.value
print(y)
win=Tk()
clicked=StringVar()
combodata=ttk.Combobox(win, width=100,state='readonly')
combodata['values']=[(y)]
combodata.pack(pady=20)
win.mainloop()
I have prepared this code. This prints all values in the column but when it comes to tkinter-dropdown, it just provides the option of last value in the range provided i.e. B10 only. Can any of you please modify this code according to my need? I have more than 1000 values in the column. Thanks in advance.