+ Reply to Thread
Results 1 to 4 of 4

[SOLVED] Truncated text when copying text from one excel doc to another

  1. #1
    sunny pete
    Guest

    [SOLVED] Truncated text when copying text from one excel doc to another

    launch two excel documents
    Enter a long text string into any cell >500 characters
    Copy the cell and paste it to any cell in the other document

    Result: the pasted text is truncated losing the end of the original text
    string.

    How can I fix this?

  2. #2
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Should'nt happen as you described - except there is a problem with a cell formatted as TEXT and a cell data length 512 to 1024 characters. (the cell is displayed as ##### symbols)

    From a worksheet, if you Move & create-a-copy a worksheet there is a limit on the contents of a cell size, but Excel will tell you of this at the time of the copy.

    For a cell, or range of cells, or whole worksheet, the Copy and Paste into a new sheet should copy all data up to 32,768 characters per cell.

    The limit on what is displayed in the cell is 1,024 characters, or 409 points of row height.

    To see the full cell contents select the cell and check the formula bar.

    Test the row height problem by reducing the font size for the cell, and remember to restore the setting afterwards



    Quote Originally Posted by sunny pete
    launch two excel documents
    Enter a long text string into any cell >500 characters
    Copy the cell and paste it to any cell in the other document

    Result: the pasted text is truncated losing the end of the original text
    string.

    How can I fix this?
    Last edited by Bryan Hessey; 08-12-2005 at 08:48 AM.

  3. #3
    Dave Peterson
    Guest

    Re: Truncated text when copying text from one excel doc to another

    Make sure you open both workbooks in the same instance of excel.

    open the first any way you want.
    but then File|open (your second workbook)

    Then do the copy|paste

    ==
    If you're opening the second workbook by double clicking on it in windows
    explorer and it opens in a second instance--and you want to stop this
    behavior...

    Sometimes one of these works:

    Tools|Options|General|Ignore other applications (uncheck it)

    --- or ---

    Close Excel and
    Windows Start Button|Run
    excel /unregserver
    then
    Windows Start Button|Run
    excel /regserver

    The /unregserver & /regserver stuff resets the windows registry to excel's
    factory defaults.

    sunny pete wrote:
    >
    > launch two excel documents
    > Enter a long text string into any cell >500 characters
    > Copy the cell and paste it to any cell in the other document
    >
    > Result: the pasted text is truncated losing the end of the original text
    > string.
    >
    > How can I fix this?


    --

    Dave Peterson

  4. #4
    BizMark
    Guest

    Re: Truncated text when copying text from one excel doc to another


    This is a common problem and one without a quick-fix as far as I know.

    I had a reason to do the same thing and I had to write a VBA routine to
    read the contents of any cells with more than 255 characters in them and
    store in a list, then open the destination workbook and re-plot the
    recorded text values.

    Something like (I'm just tapping this out off the top of my head, I'm
    only 90% sure it will work, but tweak it if necessary):

    Sub CopyLongText(xSourceSheet as Worksheet,xDestinationsheet as
    Worksheet)

    Dim tLongCells As String

    For Each xCell in xSourceSheet.UsedRange.Cells
    If Len(xCell.Text) 'greater than' 255 then
    tLongCells = tLongCells & xCell.Address & "|" & xCell.Text & "|"
    End If
    Next xCell

    xDestinationsheet.Workbook.Activate
    xDestinationsheet.Activate

    While tLongCells 'greater than' ""
    posa = instr(1,tLongCells,"|")
    posb = instr(posa+1,tLongCells,"|")
    tAddress = left(tLongCells,posa-1)
    tText = mid(tLongCells,posa+1,posb-posa-1)

    If IsError(Evaluate("=" & tText)) then
    Range(tAddress).NumberFormat = "@"
    End If
    Range(tAddress).value = tText

    tLongCells = mid(tLongCells,posb+1)
    Wend
    End Sub


    Hope this helps.

    Regards,
    BizMark


    --
    BizMark

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1