Chris

are you looking for something like this?

xlSht=xlApp.Worksheets("Sheet1")

irow=1
XL_row_has_data=1

while XL_row_has_data:
     xlRng=xlSht.Range(xlSht.Cells(irow,1),xlSht.Cells(irow,256))
     ncell=xlApp.WorksheetFunction.CountA(xlRng)

     if ncell ==0:
         # Cells in current row are all empty
         XL_row_has_data=0
     else:
         # Look in next row
         irow=irow+1

print "first row with empty cells is row "+str(irow)

HTH

Alun Griffiths


_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to