Excel sheet copy/paste problems

mingiunate

New Member
Joined
Dec 14, 2005
Messages
4
Hi!

I have a macro, and it is used to export a few worksheets by copy/pasting them into a new workbook..

However, some of the cells in the sheet i am exporting have a lot of text in them, and in the copies, the text is being cut off...


is there anythign i can do short of splitting the cells up?
can i change the format of the cell, or anything?

thanks!
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

Superstar31

Active Member
Joined
Nov 10, 2005
Messages
496
Since your using a macro, why not make the macro format the text to autowidth after it pastes it?
 

mingiunate

New Member
Joined
Dec 14, 2005
Messages
4
huh?
i have no clue what that means...


but this has nothing to do with column width...
its only copying the first 255 characters of the cells in the sheets that get copy/pasted over


thanks!
 

mingiunate

New Member
Joined
Dec 14, 2005
Messages
4

ADVERTISEMENT

Private Sub cmdRenewalPackage_Click()
Dim sName As String
Dim OLEit As OLEObject

If MsgBox("Would you like to export the Financial Package?", vbYesNo, "Export?") = vbYes Then
sName = Application.GetSaveAsFilename(filefilter:="Excel Files (*.xls),*.xls", _
Title:="Specify name and location of where to save", InitialFileName:="Financial Package.xls")
If sName = "False" Then
MsgBox "Renewal Package has not been saved.", , "Warning!"
Exit Sub
End If
Sheets(Array("Cover Page", "Table of Contents", "Summary of Cost", "Continuation Rates", _
"Summary of Cost - Billing", "Continuation Rates - Billing", "Policy Assumptions")).Select
Sheets("Cover Page").Activate
Sheets(Array("Cover Page", "Table of Contents", "Summary of Cost", "Continuation Rates", _
"Summary of Cost - Billing", "Continuation Rates - Billing", "Policy Assumptions")).Copy
sName = Replace(sName, ".xls", " - Financial Package.xls", , , vbTextCompare)
For Each OLEit In ActiveWorkbook.ActiveSheet.OLEObjects
If InStr(1, OLEit.progID, "CommandButton") <> 0 Then
OLEit.Delete
End If
Next OLEit

ActiveWorkbook.SaveAs Filename:=sName
ActiveWorkbook.Close
MsgBox "Financial Package has been saved.", , "Saved"
End If
End Sub
 

Superstar31

Active Member
Joined
Nov 10, 2005
Messages
496
OK i'm no expert, so I'm giving this the old college try, but if anyone else has any ideas I'd love to hear them
 

Superstar31

Active Member
Joined
Nov 10, 2005
Messages
496
It copied mine just fine, let me add a few lines of data to see what happens

entering I did a len count and it takes a cell full of 32676 or whatever the number is and changes it to 255?
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,167,835
Messages
5,855,910
Members
431,772
Latest member
dannyboi1

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top