Chris Hengge wrote: > This is what I have, but it requires me to know the end of the column > I'm working with, which changes. > > try:#Loop through the rows from 6 -> 25 > for row in range(6, 25): > #Write each row, increment 1+row in column 5 > print >> file, "(%d) => %s" % (row, xlSht.Cells (1+row, 5).Value) > > I'm looking for something more like > try:#Loop until rows are null > while row in xlwksht != null > #Write each row, incriment 1+row in column 5 > print >> file, "'" + %s + "',", % (xlSht.Cells(1+row,5).Value)
What is xlSht? Are you using COM, or xlrd, or pycelerator, or?? to read the spreadsheet? It probably has a way to find out the last row, or if the cell has data... Kent _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor