VBA Copy and Paste Values only then close

APML

Board Regular
Joined
Sep 10, 2021
Messages
216
Office Version
  1. 365
Hi All. Let me start by saying that I'm not very good at VBA, so need a little help.
I have 2 workbooks, one is called Journal.xlsx and the other is called abcd.xlsm. I want to copy the following (values only) from ( 2 different ranges) in abcd.xlsm to Journal.xlsm

The ranges I want to copy from and to are as follows:

From To
abcd worksheet named Sheet1, range A1 : IZ2121 Journal worksheet named Engine, paste (values only) to A1

abcd worksheet named Sheet2, range A1 : AXA2110 Journal worksheet named ASX_Data, paste (values only) to I12

After the following is done I'd like workbook abcd to close.

So far this is what I have (it does the first section of the copy and values paste only)



Sub Copy_PasteSpecial_Method()

'Copy range to clipboard
Workbooks("abcd.xlsx").Worksheets("Sheet1").Range("A1:IZ2121").Copy

'PasteSpecial to paste values, formulas, formats, etc.
Workbooks("Journal.xlsm").Worksheets("engine").Range("A1").PasteSpecial Paste:=xlPasteValues

End Sub

Would really appreciate any help
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Once again: If you would like to post the solution then it is perfectly fine to mark your post as the solution to help future readers. Otherwise, please do not mark a post that doesn't contain a solution.
 
Upvote 0

Forum statistics

Threads
1,215,463
Messages
6,124,963
Members
449,200
Latest member
indiansth

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