Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excell cuts string when copying


Hi All
I have problem with copy paste using VBA.

I have a worksheet and its filled with some data. There is also a
button that creates another worksheet ad copy some range to the new
worksheet

I am using the following code :

Dim objExcel As Excel.Application
Set objExcel = CreateObject("Excel.Application")
objExcel.Workbooks.Add
objExcel.Visible = False
Worksheets("AD Request Form").Range("A1:W12").Copy
objExcel.Range("A1:W12").PasteSpecial (xlPasteValues)


The problem is that in some cells there is a lot of text.
After copy paste in the new worksheet all strings are being cut to 255
char

Is there some workarround
Plz help it is very important to me


BR,
Krzysztof


--
temp_for_oracle
------------------------------------------------------------------------
temp_for_oracle's Profile: http://www.excelforum.com/member.php...o&userid=25912
View this thread: http://www.excelforum.com/showthread...hreadid=392881

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Excell cuts string when copying

Why are you creating another instance of Excel? Just use the current
instance and the text will not be truncated.

--
Jim
"temp_for_oracle"
<temp_for_oracle.1t8qqj_1123160773.4379@excelfor um-nospam.com wrote in
message news:temp_for_oracle.1t8qqj_1123160773.4379@excelf orum-nospam.com...
|
| Hi All
| I have problem with copy paste using VBA.
|
| I have a worksheet and its filled with some data. There is also a
| button that creates another worksheet ad copy some range to the new
| worksheet
|
| I am using the following code :
|
| Dim objExcel As Excel.Application
| Set objExcel = CreateObject("Excel.Application")
| objExcel.Workbooks.Add
| objExcel.Visible = False
| Worksheets("AD Request Form").Range("A1:W12").Copy
| objExcel.Range("A1:W12").PasteSpecial (xlPasteValues)
|
|
| The problem is that in some cells there is a lot of text.
| After copy paste in the new worksheet all strings are being cut to 255
| char
|
| Is there some workarround
| Plz help it is very important to me
|
|
| BR,
| Krzysztof
|
|
| --
| temp_for_oracle
| ------------------------------------------------------------------------
| temp_for_oracle's Profile:
http://www.excelforum.com/member.php...o&userid=25912
| View this thread: http://www.excelforum.com/showthread...hreadid=392881
|


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excell cuts string when copying


Try this...


Code:
--------------------
Sub testRemove()

Worksheets("AD Request Form").Range("A1:W12").Copy

Workbooks.Add
wsNew.Range("A1").PasteSpecial
Cells.Calculate

End Sub
--------------------


Enjoy Excelling!!!
ilyas...


--
ilyaskazi
------------------------------------------------------------------------
ilyaskazi's Profile: http://www.excelforum.com/member.php...o&userid=23969
View this thread: http://www.excelforum.com/showthread...hreadid=392881

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
copying an excell spreadsheet Templar Excel Discussion (Misc queries) 2 January 24th 08 03:58 PM
Excell formulas not copying correctly? Lost Excel Worksheet Functions 1 November 24th 06 02:48 AM
comparison string VBA excell stats Excel Discussion (Misc queries) 5 March 16th 06 10:12 PM
Excell deletes 0 when its the first number in a string dustin1138 Excel Discussion (Misc queries) 2 May 7th 05 09:08 PM
Excell question about formula copying!!! Excell question about formula copying!!! Excel Worksheet Functions 1 March 3rd 05 03:31 AM


All times are GMT +1. The time now is 11:15 AM.

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"