past no possible

fette_hehne

New Member
Joined
Oct 18, 2005
Messages
24
HI,


I created a command button which delets the any content in a certain range

Private Sub CommandButton1_Click()
Worksheets("Paste").Range("A6:N6200").ClearContents
End Sub

When I now copy a certain range from another spreadsheet and want to paste this selection into the first worksheet where I deleted the previous content neither CTRL + V nor Edit/Paste is working. What is the reason for that????

I checked under Tools/Options whether 'Show past option buttion' has been selcted and it is still ticked.
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Hello, fette_hehne,
When I now copy a certain range from another spreadsheet and want to paste this selection into the first worksheet where I deleted the previous content neither CTRL + V nor Edit/Paste is working. What is the reason for that????
in what order did you proceed ?

this won't work
COPY
click button
try to paste
why: even manually you cannot copy then do another operation and then paste

this will work
click button
COPY
PASTE

this way you can paste the values
even when you do operations in between

Code:
Public arr As Variant

Sub test()
arr = Range("A1:A10")
End Sub

Sub continue()
Range("C1").ClearContents
'any code
Range("B1:B10") = arr
End Sub

kind regards,
Erik
 
Upvote 0
That is the reason why I am suprised myself. The order is:

1) Click the command button which deletes the contents of the range
2) Go to another workbook
3) copy a range there
4) go back to the original workbook
5) paste the copied cells

For step 2 I didnt open an entirely new excel, so they are running under the same excel application.

The problem arrises at the 5) step. No past icon


However after the step 5) I type a value into a cell, select it the paste icon appears and paste is possible again.
Any idea why?
 
Upvote 0
Actually CTRL- V does not work nore Edit/Paste, however pasting via the clipboard works. What is the reason, because I do not want to be tied to only using the clipboard, as the users will want to use that funtion.
 
Upvote 0
At step 5), do you click in a cell before you try to paste? If not, does the focus remain with the CommandButton?
 
Upvote 0
Dear Erik

thank you very much. I have been sitting here for two hours to figur it out. Yes, I had the following activate event.

Private Sub Worksheet_Activate()

End Sub

I deleted it and the paste function works perfectly.
 
Upvote 0

Forum statistics

Threads
1,216,297
Messages
6,129,958
Members
449,545
Latest member
SURY

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