• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Copying and Pasting Data from One Worksheet to Another Using A Macro

j.s.ingle

New Member
Hello all/Chandoo,


I'm setting up a workbook and trying to set up a macro(from an Active X control button) that will allow me to copy and paste several fields from one worksheet to another.


So far I've gotten some of my VB coding to run but am running into problems. Below is my syntax so far. I can't seem to debug the first "Transfer.Data" line. Perhaps its in the wrong place? The "Sheets("Verbal Auth Letter").Range("B22:C22").Copy Worksheets("Section III-ISP")"


Thanks for any help


Syntax:

[pre]
Code:
Sub OptionButton311_Click()
ActiveSheet.Unprotect Password:="abi"
Sheets("Section III-ISP").Select
Range("C58:J58").Select
Selection.Copy
Sheets("Verbal Auth Letter").Select
Transfer.Data
Sheets("Verbal Auth Letter").Range("B22:C22").Copy Worksheets("Section III-ISP")
Sheets("Section III-ISP").Select
Range("B72:C72").Select
Selection.Copy
Sheets("Verbal Auth Letter").Select
Transfer.Data
Sheets("Verbal Auth Letter").Range("D22").Copy Worksheets("Section III-ISP")
Sheets("Section III-ISP").Select
Range("C77:D77").Select
Selection.Copy
Sheets("Verbal Auth Letter").Select
Transfer.Data
Sheets("Verbal Auth Letter").Range("E22").Copy Worksheets("Section III-ISP")
Sheets("Section III-ISP").Select
Range("G77:H77").Select
Selection.Copy
Sheets("Verbal Auth Letter").Select
Transfer.Data
Sheets("Verbal Auth Letter").Range("F22").Copy Worksheets("Section III-ISP")
ActiveSheet.Protect Password:="abi"
End Sub
[/pre]
 
Hi,

I hope I understood your problem. The basic way in which I would do the copy/paste


Sub Macro2()


ActiveSheet.Unprotect Password:="abi"


'Why the range you paste to has a different size than the one you copy from?'

Sheets("Verbal Auth Letter").Range("B22:C22") = Sheets("Section III-ISP").Range("C58:J58").Value


End Sub
 
Back
Top