[Tutor] Traversing Excel Columns

Chris Hengge pyro9219 at gmail.com
Mon Sep 11 23:53:33 CEST 2006


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)

Maybe someone already tackled this? Or am I over thinking this problem?

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20060911/c7d06be0/attachment.html 


More information about the Tutor mailing list