Page 1 of 1

Copy a cell and paste its value

Posted: Sun Feb 21, 2010 5:38 pm
by tbrantly
How do I remove the formula from a cell and replace it with the value the formula calculated?

Title Edited. A descriptive title for posts helps others who are searching for solutions and increases the chances of a reply (Hagar, Moderator).

Re: Problem with spreadsheet

Posted: Sun Feb 21, 2010 5:52 pm
by Robert Tucker
Why would you want to do that?

Re: Problem with spreadsheet

Posted: Sun Feb 21, 2010 11:35 pm
by Hagar Delest
You mean the equivalent of the Paste>Value in MS Excel?

Try the long click on the paste icon (or click its little arrow) and use Unformatted text.

Thanks to add '[Solved]' at beginning of your first post title (edit button) if your issue has been fixed.

Re: Problem with spreadsheet

Posted: Mon Feb 22, 2010 6:33 am
by vasa1
Hagar de l'Est wrote:You mean the equivalent of the Paste>Value in MS Excel?

Try the long click on the paste icon (or click its little arrow) and use Unformatted text.

Thanks to add '[Solved]' at beginning of your first post title (edit button) if your issue has been fixed.
I searched for the keyboard equivalent but couldn't find it. Is there one? I've been using the more cumbersome "Alt, edit, paste special", and then changing the defaults to exclude "paste all", "paste formulas" and "paste formats", but to include numbers. Of course, this has to be done only once per session. After the first time I set it, it is just Alt, E, S, enter, enter.

And Robert Tucker asked, "Why would you want to do that?". Well, in my case, I don't need the formula that generated the value in a temp worksheet any more.

Re: Problem with spreadsheet

Posted: Mon Feb 22, 2010 11:24 am
by Hagar Delest
vasa1 wrote:I searched for the keyboard equivalent but couldn't find it. Is there one?
No idea, I usually prefer to use the buttons instead of the keyboard.

Re: Problem with spreadsheet

Posted: Mon Feb 22, 2010 11:51 am
by vasa1
Hagar de l'Est wrote:
vasa1 wrote:I searched for the keyboard equivalent but couldn't find it. Is there one?
No idea, I usually prefer to use the buttons instead of the keyboard.
That's okay! Gave me a chance to record my third ever macro :D . So now, Alt+V will do it for me.

Re: Copy a cell and paste its value

Posted: Tue Mar 09, 2010 6:34 pm
by vasa1
This is what the macro I recorded looks like:

Code: Select all

sub MyPaste
rem ----------------------------------------------------------------------
rem define variables
dim document   as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

rem ----------------------------------------------------------------------
dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = "SelectedFormat"
args1(0).Value = 1

dispatcher.executeDispatch(document, ".uno:ClipboardFormatItems", "", 0, args1())


end sub
I assigned Alt+V to it. If it's just one cell or just one row, pressing Alt+V pastes the unformatted contents, but if it's more than one row, I have to hit enter after Alt+V to complete the paste.

Re: Copy a cell and paste its value

Posted: Tue Mar 09, 2010 6:53 pm
by acknak
This feature was added to OOo 3.2; you don't need a macro to do it.

There is a "paste unformatted" function, bound to Ctrl+Alt+Shift+V by default; you can bind a different key combination using the Tools > Customize dialog window.

Oops--Sorry. It works in Writer, but apparently not in Calc. My understanding is that the new function was supposed to apply to all the OOo applications, but maybe I missed something.

Re: Copy a cell and paste its value

Posted: Wed Mar 10, 2010 4:33 am
by vasa1
acknak wrote:This feature was added to OOo 3.2; you don't need a macro to do it.

There is a "paste unformatted" function, bound to Ctrl+Alt+Shift+V by default; you can bind a different key combination using the Tools > Customize dialog window.

Oops--Sorry. It works in Writer, but apparently not in Calc. My understanding is that the new function was supposed to apply to all the OOo applications, but maybe I missed something.
I had the same experience. After making the macro, I too read about this "Ctrl+Alt+Shift+V" but didn't get it to work in Calc.

Re: Copy a cell and paste its value

Posted: Wed Mar 10, 2010 10:16 pm
by Hagar Delest
vasa1 wrote:didn't get it to work in Calc.
+1 with OOo 3.2 and xubuntu 9.10. No shortcut at all linked to that shortcut.

Re: Copy a cell and paste its value

Posted: Thu Jun 27, 2019 9:16 am
by davesolomon
The new version I am using of OpenOffice allows me to paste the value only on a mac by using the Command-Shift V when pasting the copied cell.