Solved

paste method not working in vb 6.0

Posted on 2007-03-29
1
179 Views
Last Modified: 2010-05-03
What is wrong with the code in the line marked.

For OutVar = 2 To TotalVariableCount + 1 'COPY ALL THE ACTUAL DATA POINT TO THE ERRORFUNCTIONALL
FinalSheet.range(FinalSheet.Cells(2, OutVar), FinalSheet.Cells(ACTUALDATAPOINTS + 1, OutVar)).Copy
cellvalue = ColCounter * ACTUALDATAPOINTS + 2
ErrorAllsheet.range(ErrorAllsheet.Cells(cellvalue, 1), ErrorAllsheet.Cells(cellvalue, 1)).Paste <------
ColCounter = ColCounter + 1

Next OutVar
0
Comment
Question by:Aiysha
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 35

Accepted Solution

by:
mvidas earned 500 total points
ID: 18818690
Hi Aiysha,

.Paste only works on a worksheet variable, not on a range like you have. You could either put .PasteSpecial instead, or put that range as the Destination argument of the .Copy method (my recommendation):

For OutVar = 2 To TotalVariableCount + 1 'COPY ALL THE ACTUAL DATA POINT TO THE ERRORFUNCTIONALL
FinalSheet.range(FinalSheet.Cells(2, OutVar), FinalSheet.Cells(ACTUALDATAPOINTS + 1, OutVar)).Copy ErrorAllsheet.Cells(ColCounter * ACTUALDATAPOINTS + 2, 1)
ColCounter = ColCounter + 1

Next OutVar

Matt
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month9 days, 1 hour left to enroll

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question