Cutting or moving cell contents moves cell border/format.

Discuss the spreadsheet application
Post Reply
bladesman
Posts: 1
Joined: Sat Feb 16, 2008 5:38 am

Cutting or moving cell contents moves cell border/format.

Post by bladesman »

I'm kinda at a loss over this...

I've created a simple spread sheet in Calc. All it really is, is cells 3 columns across formatted with borders for making a list to print out.
Whenever I drag and drop, cut and paste, or otherwise try to move the contents of a cell or group of cells (just text, no formulas), the cell border/formatting is removed from the original cells and moved/copied to the destination cells.

I would like to retain or lock the cell formatting/borders and just be able to drag/move the contents but I can't seem to figure out how to do this. What am I missing? If I protect the sheet, I can't enter any data (but at least the borders stay put!)

It's probably something simple, but I just can't seem to figure it out.

I've spent about an hour trying to search the forums but haven't come up with any reference to this.

(I did find a helpful tip on moving/dragging single cells.)

I checked the Help (first thing) and couldn't seem to come up with anything with the searches I was using.

Any help would be greatly appreciated.

It's late, I'm tired, and I have a cold. I can't seem to come up with any other ideas...

OS = Windows Vista
OOo ver = Calc 2.2.1
User avatar
kingfisher
Volunteer
Posts: 2123
Joined: Tue Nov 20, 2007 10:53 am

Re: Cutting or moving cell contents moves cell border/format.

Post by kingfisher »

I get the same results. You will have to copy then special paste "contents only" (i.e. no formats) to the destination. You will then have to delete the contents of the original cells. I have a macro that pastes contents only if you want it:

Code: Select all

Sub PasteContents

'Paste contents without notes, formatting and objects.
Dim aPaste( 5 ) as new com.sun.star.beans.PropertyValue
aPaste(0).name = "Flags"
aPaste(0).Value = "SVDF" 'paste strings, values, dates/times and formulas
aPaste(1).name = "FormulaCommand"
aPaste(1).Value = 0
aPaste(2).name = "SkipEmptyCells"
aPaste(2).Value = false
aPaste(3).name = "Transpose"
aPaste(3).Value = false
aPaste(4).name = "AsLink"
aPaste(4).Value = false
aPaste(5).name = "MoveMode"
aPaste(5).Value = 4
vDispatcher = createUnoService( "com.sun.star.frame.DispatchHelper" )
vFrame = ThisComponent.getCurrentController().getFrame
vDispatcher.executeDispatch( vFrame, ".uno:InsertContents", "", 0, aPaste() )

End Sub
Apache OpenOffice 4.1.9 on Linux
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Cutting or moving cell contents moves cell border/format.

Post by Villeroy »

Did you try Edit>Paste Special (shortcuts "Ins"-key or Ctrl+Shift+V) and Edit>Delete Contents (shortcut: "Del"-key)?
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
User avatar
kingfisher
Volunteer
Posts: 2123
Joined: Tue Nov 20, 2007 10:53 am

Re: Cutting or moving cell contents moves cell border/format.

Post by kingfisher »

That will not prevent the removal of the borders from the original cells.
Apache OpenOffice 4.1.9 on Linux
Post Reply