Solved

paste method not working in vb 6.0

Posted on 2007-03-29
1
173 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
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

828 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