worksheet.copy truncates at 255 characters

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi, I have tried to use
worksheet.copy after:= etc etc
to copy data from one worksheet to another but when cells contains more than
255 characters it will be truncated. Does anyone has a solution to this?

/Pelle
 
One way is to a add a new sheet and use
Cells.copy to copy all cells to the new sheet.

Dim ws As Worksheet
Dim ws2 As Worksheet

Set ws = ActiveSheet
Set ws2 = Worksheets.Add

ws.Cells.Copy ws2.Range("A1")
 
I'd use a combination of what you do and what Ron suggested.

dim wks as worksheet
dim newWks as worksheet

set wks = worksheets("somesheetname")

wks.copy 'to a new workbook?

set newwks = activesheet

'go back and get the values (including the long ones)

wks.cells.copy _
destination:=newwks.range("a1")

======
This way, I get all the page setup, filters, freeze panes, etc that are on the
original worksheet.
 
Back
Top