Copy paste special change in macro

Ricki

New Member
Joined
Sep 5, 2014
Messages
28
Office Version
  1. 365
Platform
  1. Windows
I have a macro which I use to copy item from one workbook to another without copying any formulas.
The macro has been working without any problems until this morning. If I copy 1 row 1 column, to paste to another workbook, it does copy fine but then clears the row below of any information that's there.

Has there been a change in the way paste special works?

My macro is as follows:
On Error Resume Next
ActiveSheet.PasteSpecial Format:="Text", Link:=False, DisplayAsIcon:= _
False
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
I hope this helps:
VBA Code:
Sub Special_change()
On Error GoTo errorhandler

    With ActiveSheet
        .PasteSpecial Paste:=xlPasteValues
        .PasteSpecial Format:="Text"
    End With
ErrrorHandler:
    MsgBox "Error encountered.", vbCritical + vbApplicationModal, "Copy paste special"
End Sub
 
Upvote 0
That's basically what I have. The code that I have, was made by recording my keystroke. Made by excel itself.

It copies fine but then deletes the row (cells) under where I'm pasting.
 
Upvote 0
Hmmm... that's odd. Do you specifically need it as text format? If not then erase that line of code.

Explain what you are doing excatly... I have 10 minutes to spare.
 
Upvote 0
What I'm doing is copying data from one workbook, to another, both formatted differently. The data is Text. Titles and Artists. Sometimes, the item which is being copy, is copied to a empty set of cells in between cells which have data. That's how I noticed this problem, just recently. Then I have to recreate the delete cells.
 
Upvote 0
If it is text you don't need that specified in the code.Post a sample of the source and destination sheets here and I'll have a look tomorrow.
 
Upvote 0

Forum statistics

Threads
1,224,898
Messages
6,181,625
Members
453,058
Latest member
rmd0725

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