VBA ERROR: Cannot Paste the Selected Copied Content

lazzarox2

New Member
Joined
Mar 6, 2024
Messages
6
Office Version
  1. 365
I have one open xls file and I am opening a second one to copy data from. 1. Last istruction does not paste the content. 2. If I want to copy 250 cells, when closing the file, how can I save the date in the memory? THANKS

Workbooks.Open ("C:\XLSX\1 (1)Output.xlsx")

Sheets("1(1).MatchType1").Select
Range("B2").Select
Range("B2:B101").Select

Selection.Copy

Workbooks("1 (1)Output.xlsx").Close
'Workbooks("RESULTS Tables 1 and 2.xlsx").Select
Sheets("Result 1").Select
Range("B3:cw3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=True
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Try pasting the data BEFORE closing the workbook.
 
Upvote 0
Hi. Thanks for your message. I did. But it seems I make a mistake to reactivate/ select the initial file. It blocks here now:
Workbooks("RESULTS Tables 1 and 2.xlsm").Select
 
Upvote 0
Can you please your complete code, as you have it now?
And please use Code Tags when posting code, for readability sake (see here: How to Post Your VBA Code).
 
Upvote 0
1709825280775.png

Does anyone know how to write in the macro the istruction Y or N for the above, after paste?
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,322
Members
452,635
Latest member
laura12345

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