Nov-02-2018, 06:24 AM
Hi,
Suppose you are using python code to enter cell values into a spreadsheet like so:
I've been changing the A-numbers manually and I realize I'm missing out on the basic power of Python by not entering these values using a list and than iterating over the list within the cell. (I'm a new programmer and not feeling so smart so take it easy
)
Thanks for looking this over. I have a hunch I'm wasting a lot of time with this.
Phil
Suppose you are using python code to enter cell values into a spreadsheet like so:
sheet['A1'].value = '01' sheet['A2'].value = '02' sheet['A3'].value = '03' sheet['A4'].value = '04' sheet['A5'].value = '05' sheet['A6'].value = '06' sheet['A7'].value = '07' sheet['A8'].value = '08' sheet['A9'].value = '09' sheet['A10'].value = '10'Then you realize cell 'A2' actually needs a value of '01a' inserted and all the other cells need to drop down one number, so A2 becomes A3, A3 becomes A4, etc.
I've been changing the A-numbers manually and I realize I'm missing out on the basic power of Python by not entering these values using a list and than iterating over the list within the cell. (I'm a new programmer and not feeling so smart so take it easy


sheet['A1 + increment'].value = 'LIST ITERATION'Would this be the way to do it (which would mean a lot of refactoring for me), or is there a way to quickly increment the A1, A2, A3, etc. within the python code itself?
Thanks for looking this over. I have a hunch I'm wasting a lot of time with this.

Phil
