View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_3_] Dave Peterson[_3_] is offline
external usenet poster
 
Posts: 2,824
Default Long Text in merged cells not copying correctly with sheet

After you copy the worksheet, you could copy the cells in the original worksheet
and paste them right over the new worksheet.

shtmetric.copy _
befo=wkbkmetricdata.worksheets(1)

shtmetric.cells.copy _
destination:=wkbkmetricdata.worksheets(1).range("a 1")




Paul Willman wrote:

I have a vb6 app that copies a sheet in a workbook into another workbook
The VB code is:

shtMetric.Copy wkbMetricData.Worksheets(1)

where shtMetric is defined as an Excel.Worksheet object and wkbMetricData is
defined as an Excel.Workbooks object.

Cells the block of cells from A1 to J4 are merged into one cell, giving me a
large space to display a lot of text. However, when I copy this sheet into
another workbook, the text in that merged cell is trunctated to 255
characters, forcing me to manually copy the data in the cell with a second
line of code:

wkbMetricData.Worksheets(1).Range("A1").Value =
shtMetric.Range("A1").Value

This is sloppy and there must be something going on that I can address to
make sure this cell copies correctly, along with the rest of the sheet.

Thanks for any ideas you may have,

Paul Willman


--

Dave Peterson