#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2014
    Posts
    1
    Rep Power
    0

    Randomize search in excel


    I started learning python and was trying to work on a small project for myself. Its just to open an excel spreadsheet then look in one column and then randomly choose one of the cells to print. I did some research and found multiple ways to do it but kind of liked this one due to it being short and sweet. The problem I am having is just when it prints i want it to randomize the selection in one column. So wanted to know if there is a way for me to do it. Thanks all help will be appreciated!!!!

    import xlrd

    wb = xlrd.open_workbook("quotes.xlsx")
    sh1 = wb.sheet_by_index(0)
    print sh1.cell(0,0).value
  2. #2
  3. Contributing User

    Join Date
    Aug 2011
    Posts
    5,110
    Rep Power
    482
    You'll need, among other things, this.
    [code]Code tags[/code] are essential for python code and Makefiles!

IMN logo majestic logo threadwatch logo seochat tools logo