Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Member
 
Location: London
Posts: 78
Default

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

Last edited by BizMark : August 12th 05 at 02:14 PM
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
Text Columns Negative Numbers Upgrade Excel? Dust Bun Excel Discussion (Misc queries) 1 July 22nd 05 06:07 PM
justify text in a text box in excel Christine Excel Discussion (Misc queries) 2 July 20th 05 08:53 PM
Exporting excel to text file Exceluser Excel Discussion (Misc queries) 1 July 1st 05 03:04 AM
I need shortcut in Excel for coping text only and not the entire c UABCSA Excel Discussion (Misc queries) 4 April 14th 05 01:58 AM
Copying Excel object back into Excel from Word Regina Excel Discussion (Misc queries) 2 March 29th 05 06:57 PM


All times are GMT +1. The time now is 03:27 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"