Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default 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.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default 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.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Printing truncates cell contents BDT Excel Discussion (Misc queries) 6 November 7th 08 02:43 AM
Formulas to copy contents of one cell in a worksheet to another ce Coachy Excel Discussion (Misc queries) 1 November 11th 06 02:13 AM
worksheet.copy truncates at 255 characters Pelle Excel Programming 3 August 9th 06 09:33 AM
how to copy cell contents from one workseet to another worksheet? James Excel Discussion (Misc queries) 1 January 21st 06 09:12 PM
Copy cell contents to another worksheet ndavies Excel Programming 2 June 21st 04 10:06 PM


All times are GMT +1. The time now is 04:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"