You are here:

Excel/Macro for CUT and PASTE VALUE


Hi Tom,

My sorry for the last question, i have expressed me wrong.
I need a macro that makes the CUT can be pasted in value.
Copy i know thats work but i dont know how to CUT and PASTE in value.

Can you help me with that?


to do a cut and paste, you select a range, cut, select another range and then paste.

in code you can make the source variable, but you need to already know the destination.  

Selection.Cut Range("B9")

As you already state, you can't pastespecial manually with a cut.  So to do what you describe, you need to copy, do a pastespecial, then clear what you copied.  

to do what you describe this code works, but the destination is already specified

Sub ABC()
Dim r as range
set r = selection
selection.pastespecial xlValues
End sub

So what we are missing is an ability to specify where to paste special.   You could add code to allow you to prompt for the destination.  You can use the mouse to select the destination cell.

Sub ABC()
Dim r As Range, rDest As Range
Set r = Selection
On Error Resume Next
Set rDest = Application.InputBox("Select one cell to paste to: ", Type:=8)
Set rDest = rDest(1)
On Error GoTo 0

If rDest Is Nothing Then
 MsgBox "No destination selected."
 Application.CutCopyMode = False
rDest.PasteSpecial Paste:=xlPasteValues
End If
End Sub

That is about the best I can offer.  I tested it an it worked as I expect.  

Tom Ogilvy
About Excel
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here


All Answers

Answers by Expert:

Ask Experts


Tom Ogilvy


Selected as an Excel MVP by Microsoft since 1999. Answering Excel questions in Allexperts since its inception in 2001. Able to answer questions on almost all aspects of Excel's internal capabilities. If seeking a VBA solution, please specify that in your question itself so I give you the answer you want. [Excel has weak protection - if you are distributing an application, I don't answer questions on how to protect your project from your users.]


Extensive experience.

Master of Science (MS) degree Operations Research (ORSA)

Awards and Honors
Microsoft MVP in Excel.

©2016 All rights reserved.