ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Array problem (https://www.excelbanter.com/excel-programming/436868-array-problem.html)

UB

Array problem
 
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(kar y, 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



joel[_279_]

Array problem
 

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


--
joel
------------------------------------------------------------------------
joel's Profile: http://www.thecodecage.com/forumz/member.php?userid=229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=158445

Microsoft Office Help


Bernie Deitrick

Array problem
 
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


"ub" wrote in message
...
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(kar y, 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






All times are GMT +1. The time now is 01:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com