Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

paste method not working in vb 6.0

Posted on 2007-03-29
1
Medium Priority
?
182 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 2000 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…
Suggested Courses

730 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