VBA Copy/Paste Data

jdub84

New Member
Joined
Apr 5, 2013
Messages
6
I'm trying to write a code that copy/paste from one worksheet to another. I'm trying to choose specific columns in the Worksheet titled "FY 13 S3 FR PUF" and copy those into "ProvCBSA AHW Analysis."

Here's the code I have written but cannot get it to work:

Sub CopyData()

Sheets("FY 13 S3 FR PUF").Select
Range("A9").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy

Sheets("ProvCBSA AHW Analysis").Select
Range("A10").Select
Selection.PasteSpecial Paste:=xlPasteValues
End Sub

Also, I would like to add additional columns - once I get this to work, can I simply recreate the coe above and just change the cells locations to the new columns I would like to copy/paste?

Thanks!
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Code:
Sub CopyData()

Sheets("ProvCBSA AHW Analysis").Range("A10") = Sheets("FY 13 S3 FR PUF").Range("A9").Value

End Sub
 
Upvote 0
Sorry, misread your requirement:

Code:
Sub CopyData()

Sheets("FY 13 S3 FR PUF").Range("A9").End(xlDown).Copy
Sheets("ProvCBSA AHW Analysis").Range("A10").PasteSpecial Paste:=xlPasteValues

End Sub
 
Upvote 0
Thanks but this does not copy the entire column from A9 to the last cell populated. Any other ideas?
 
Upvote 0
Try:

Sheets("FY 13 S3 FR PUF").Range("A9:A" & Range("A" & Rows.Count).End(xlUp).Row).Copy
 
Upvote 0
I think something that could be causing it to be unsuccessful is that the data on "FY 13 FR PUF" is autofiltered. I only want that data from the autofilter copy/paste to the "ProvCBSA AHW Analysis."
 
Upvote 0
I'm using this now but I would like to copy/paste more columns. For instance, I would like to add Column B, I, J, K, etc....

Sub CopyData()

Sheets("FY 13 S3 FR PUF").Range("A9:A5000" & Range("A" & Rows.Count).End(xlUp).Row).Copy
Sheets("ProvCBSA AHW Analysis").Range("A10").PasteSpecial Paste:=xlPasteValues

End Sub
 
Upvote 0

Forum statistics

Threads
1,214,826
Messages
6,121,792
Members
449,048
Latest member
greyangel23

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top