PC Review


Reply
Thread Tools Rate Thread

Array problem

 
 
ub
Guest
Posts: n/a
 
      1st Dec 2009
Hi

In my code, I am storing the data of the worksheet in an array and then
trying to paste the array into another worksheet. But the data in of the
columns has text for about 600 characters. I am able to paste the array into
another worksheet. But the column that has text character does gets cut off
after few hundered rows.

My data set is as follows
Column A Column b Column C Column D


Has data Has Numeric has numeric Has text
with approx
Y/N data data
600 Charcters

My code is
********************
Dim kary As Variant

kary = ActiveWorkbook.Worksheets("Sheet1").Range("a2", "d2000").Value

Worksheets("Sheet2").Range("a2").Resize(UBound(kary, 1), 4).Value = kary

**************

Data in coulmn D only gets pasted for few hunderd rows.

Is there some problem is defining the array. Or is there a better way to
accomplish my task. I don't want to use copy and paste function


 
Reply With Quote
 
 
 
 
Bernie Deitrick
Guest
Posts: n/a
 
      1st Dec 2009
ub,

Not sure if Sheet2 is meant to be in the Activeworkbook or not. If it is, then:

Worksheets("Sheet2").Range("A22000").Value = Worksheets("Sheet1").Range("A22000").Value

HTH,
Bernie
MS Excel MVP


"ub" <(E-Mail Removed)> wrote in message
news:FD04C200-56D0-401A-A521-(E-Mail Removed)...
> Hi
>
> In my code, I am storing the data of the worksheet in an array and then
> trying to paste the array into another worksheet. But the data in of the
> columns has text for about 600 characters. I am able to paste the array into
> another worksheet. But the column that has text character does gets cut off
> after few hundered rows.
>
> My data set is as follows
> Column A Column b Column C Column D
>
>
> Has data Has Numeric has numeric Has text
> with approx
> Y/N data data
> 600 Charcters
>
> My code is
> ********************
> Dim kary As Variant
>
> kary = ActiveWorkbook.Worksheets("Sheet1").Range("a2", "d2000").Value
>
> Worksheets("Sheet2").Range("a2").Resize(UBound(kary, 1), 4).Value = kary
>
> **************
>
> Data in coulmn D only gets pasted for few hunderd rows.
>
> Is there some problem is defining the array. Or is there a better way to
> accomplish my task. I don't want to use copy and paste function
>
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Array problem: Key words-Variant Array, single-element, type mismatch error davidm Microsoft Excel Programming 7 11th Jun 2011 12:01 AM
Problem instantiating an array of objects or array of class instances raylopez99 Microsoft C# .NET 3 17th Sep 2007 07:16 PM
Array problem: Key words-Variant Array, single-element, type mismatch error davidm Microsoft Excel Programming 1 8th Nov 2005 04:21 AM
Problem converting managed array (C++) to C# array Dick Swager Microsoft C# .NET 2 30th Aug 2005 02:53 AM
Problem converting managed array (C++) to C# array Dick Swager Microsoft VC .NET 2 30th Aug 2005 02:53 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:37 PM.