Re: Python-Excel: How to paste selected cells (range) to different location on the same sheet in Excel

2005-08-09 Thread Stuart Corrie
Did you use the excel macro recorder and look at the results to help you write that program? It seems to bear all the hallmarks of code generated that way. The macro recorder can be great, but almost always it is possible to speed up code by altering it afterwards, to condense and speed up the

Re: Python-Excel: How to paste selected cells (range) to different location on the same sheet in Excel

2005-08-04 Thread mimicico
I think you just need do: sh.Range(sh.Cells(4,1),sh.Cell­s(6,3)).Value = sh.Range(sh.Cells(1,1),sh.Cell­s(3,3)).Value -- http://mail.python.org/mailman/listinfo/python-list

Re: Python-Excel: How to paste selected cells (range) to different location on the same sheet in Excel

2005-08-03 Thread zxo102
I found the solution for this. It needs to select a new location and paste from "sh". Thank you for your reading this. import win32com.client xl=win32com.client.Dispatch("E­xcel.Application") xl.Visible=1 wb = xl.Workbooks.Add( ) sh=wb.Worksheets(1) sh.Cells(1,1).Value = "Hello World!" sh.Cells(3,

Python-Excel: How to paste selected cells (range) to different location on the same sheet in Excel

2005-08-03 Thread zxo102
Hi there, I need your help for python <--> excel. I want to paste selected cells (range) to different location on the same sheet in Excel through python. I have tried it for a while but could not figure it out. Here is my sample code: import win32com.client xl=win32com.client.Dispatch("Excel.A