ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Worksheet.Copy() truncates cell contents problem (https://www.excelbanter.com/excel-programming/390194-worksheet-copy-truncates-cell-contents-problem.html)

Mark Hanley

Worksheet.Copy() truncates cell contents problem
 
I have written a macro which copies a worksheet and then alters some
of the values in the copied sheet.

Everything works fine except that any text cells with more than 255
characters are truncated.

Is there a way I can stop excel doing this?

TIA
Mark.


JLGWhiz

Worksheet.Copy() truncates cell contents problem
 
Maximum column width up through Excel 2003 is 255 characters.


"Mark Hanley" wrote:

I have written a macro which copies a worksheet and then alters some
of the values in the copied sheet.

Everything works fine except that any text cells with more than 255
characters are truncated.

Is there a way I can stop excel doing this?

TIA
Mark.



Gary''s Student

Worksheet.Copy() truncates cell contents problem
 
1. Do the worksheet copy first
2. have the macro go back to the original sheet and look for text cells
containing more than 255 characters and copy them individually
--
Gary''s Student - gsnu200725


"Mark Hanley" wrote:

I have written a macro which copies a worksheet and then alters some
of the values in the copied sheet.

Everything works fine except that any text cells with more than 255
characters are truncated.

Is there a way I can stop excel doing this?

TIA
Mark.



Ron de Bruin

Worksheet.Copy() truncates cell contents problem
 
You can do this

After you copy the whole sheet
Copy all cells from the source sheet and copy it in the new sheet

sheets("sheet1").cells.copy destsheet.cells(1)

If you not care about the settings of the sheet settings
You can insert a new sheet and copy all cells in this new sheet


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Mark Hanley" wrote in message ups.com...
I have written a macro which copies a worksheet and then alters some
of the values in the copied sheet.

Everything works fine except that any text cells with more than 255
characters are truncated.

Is there a way I can stop excel doing this?

TIA
Mark.



All times are GMT +1. The time now is 07:50 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com