John Machin,
Thank you for your piece of code. I feel I am almost there and probably inexperience is keeping from achieving my goal.
I am able to make your code work until I add my variable to the ws.write() statement. ws.write(rowx+offset,colx,bdat) with bdat being the cell data from the second sheet.
If I replace bdat with 'text', it works great.
can you see what is missing? here is my complete code.
--------------------------------------------------------------------------------
from xlrd import open_workbook,cellname
from xlwt import easyxf
from xlutils.copy import copy
rba = open_workbook('D:\\PythonData\\PythonScripts\\CCC\\TestFile_A.xls')
rbb = open_workbook('D:\\PythonData\\PythonScripts\\CCC\\TestFile_B.xls')
shta = rba.sheet_by_index(0)
shtb = rbb.sheet_by_index(0)
wb = copy(rba)
ws = wb.get_sheet(0)
offset = shta.nrows
for rowx in xrange(shtb.nrows):
for colx in xrange(shtb.ncols):
bdat = shtb.cell(rowx,colx)
print bdat
ws.write(rowx+offset,colx,bdat)
wb.save('D:\\PythonData\\PythonScripts\\CCC\\TestFileOut_2.xls')
----------------------------------------------------------------------------------------
Thank you for your help.
JohnC
On Wednesday, May 30, 2012 8:14:22 AM UTC-7, JohnC wrote: