Paste Special in macro not working

scrupul0us

Well-known Member
Joined
Sep 7, 2004
Messages
641
Ive got an entire column of formulated text in a column, and im trying to copy just the result over to another column, when I manually do paste special > VALUES it works fine. When it embedded in my macro it copies down the first value of the reference column for the entire destination column:

Code:
    Columns("D:D").Select
    Selection.Copy
    Columns("C:C").Select
    Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
    False, Transpose:=False
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Your code for paste special is right but try this:

cells(1,3).select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False

You don't need to select the whole col to paste special.
 
Upvote 0
I couldn't get your code to fail but you don't need to select the range in order to copy it:

Try this:

Code:
Sub copyCtoD()
Range("D:D").Copy
Range("C:C").PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
End Sub
 
Upvote 0
That still causes my issue... wtf is goin on here! Is there a way to just convert the original column from calculated values to just the resultant value and discard the formula?
 
Upvote 0
I also tried:

Code:
    For Each C In Columns("C:C").SpecialCells(xlCellTypeConstants, 3)
    C.Value = C.Offset(0, 1).Value
    Next C

But it says no cells found..

To me that says for each C (row) on column C set the value of the current cell to the value of its neighbor one over...
 
Upvote 0
Cells(1,3) is the easy way to reference C1. 1 being row 1 and 3 being Col. 3.

If you have just copied all the data in Col. D you only need to paste (or paste special as the case may be) into cell C1 to transfer the data.
 
Upvote 0
I'm not getting that error either :-?
As a workaround, you could save it as a .txt file, use the import wizard to reopen the .txt file, and then tell it to save again as an Excel
 
Upvote 0
Thats way too much work for something so simple...

There has to be a way todo it with a loop if not with paste special
 
Upvote 0
If you can phisically do it why dont you do it and record the macro. Then you can just add the code in to your existing code.
 
Upvote 0

Forum statistics

Threads
1,226,237
Messages
6,189,801
Members
453,569
Latest member
Kevo85

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