copy/paste

jarhead58

Active Member
Joined
Sep 21, 2017
Messages
367
Office Version
  1. 2021
Platform
  1. Windows
Why wouldn't this code work in a macro activated by a command button! It copies the cell to the clipboard but won't finish with the paste! Stumped!!:confused:

P.S. Button is on active cell sheet.

Code:
Worksheets("Sheet1").Range("N2").CopyActiveCell.PasteSpecial Paste:=xlPasteFormats
ActiveCell.PasteSpecial Paste:=xlPasteValues
 
Last edited:

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
I basically used triangle shapes with no fill to show bases and then filled black what I needed.
 
Last edited:
Upvote 0
Shapes will not copy over as they are nothing to do with the format.
 
Upvote 0
Shapes will not copy over as they are nothing to do with the format.

I just used this and it worked for that particular cell! hmmm..

Code:
Sheets("Sheet1").Range("N2").SelectSelection.Copy
Range("F13").Select
ActiveSheet.Paste
 
Upvote 0
I just used this and it worked for that particular cell! hmmm..

Code:
Sheets("Sheet1").Range("N2").SelectSelection.Copy
Range("F13").Select
ActiveSheet.Paste

The Selection.copy is actually not together as in the post lol!! Just saw that.
 
Upvote 0
Glad it's sorted & thanks for the feedback
 
Upvote 0
Glad it's sorted & thanks for the feedback

Lol, no, it''s still not doing what I would like it to do. I need it to copy to the active cell in the sheet. I can't use the range for a single cell since it will vary.
 
Upvote 0
In that case is this what you want
Code:
Worksheets("Sheet1").Range("N2").Copy
ActiveSheet.Paste
 
Upvote 0
In that case is this what you want
Code:
Worksheets("Sheet1").Range("N2").Copy
ActiveSheet.Paste

It works!!! Thank you so much!!! The crazy thing is, I'm almost certain I tried that in an earlier version but I guess not!!
 
Upvote 0
Glad to help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,632
Latest member
jladair

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