Array problem

U

ub

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
 
J

joel

ActiveWorkbook.Worksheets("Sheet1").Range("a2", "d2000").Copy _
Destination:=Worksheets("Sheet2").Range("a2")
 
B

Bernie Deitrick

ub,

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

Worksheets("Sheet2").Range("A2:D2000").Value = Worksheets("Sheet1").Range("A2:D2000").Value

HTH,
Bernie
MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top