Solved

paste method not working in vb 6.0

Posted on 2007-03-29
1
162 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
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

744 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now