Control apostrophe

Request For Enhancement, User feedback candidates for wiki
Post Reply
jbergx53
Posts: 4
Joined: Wed Mar 22, 2017 10:47 pm

Control apostrophe

Post by jbergx53 »

CALC would be greatly improved if the EXCEL feature of the Control Apostrophe were added. This feature replicates the content of the cell above it.
Open Office 4.1.1 - Windows 10
User avatar
RusselB
Moderator
Posts: 6646
Joined: Fri Jan 03, 2014 7:31 am
Location: Sarnia, ON

Re: Control apostrophe

Post by RusselB »

OpenOffice 4.1.7, LibreOffice 7.0.1.2 on Windows 7 Pro, Ultimate & Windows 10 Home (2004)
If you believe your problem has been resolved, please go to your first post in this topic, click the Edit button and add [Solved] to the beginning of the Subject line.
User avatar
Zizi64
Volunteer
Posts: 11352
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Control apostrophe

Post by Zizi64 »

CALC would be greatly improved if the EXCEL feature of the Control Apostrophe were added. This feature replicates the content of the cell above it.
A simple reference is not appropriate for you?

Code: Select all

A2: "Hello world!"
A1: =A2
Or you can write a simple macro code for copying the content of the selected cell into the cell above...
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Control apostrophe

Post by acknak »

LibreOffice provides this shortcut. It is very handy.

You may be able to get it with a recorded macro in AOO—don't know for sure, but maybe worth playing with.
AOO4/LO5 • Linux • Fedora 23
jbergx53
Posts: 4
Joined: Wed Mar 22, 2017 10:47 pm

Re: Control apostrophe

Post by jbergx53 »

Thank you both, Zizi64 and acknak!
Open Office 4.1.1 - Windows 10
User avatar
Zizi64
Volunteer
Posts: 11352
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Control apostrophe

Post by Zizi64 »

LibreOffice provides this shortcut. It is very handy.
Oooops!
I never heard about it. The Hungarian keyboard layout is basicly different therefore the ' (aphostrophe) sign is available at Shift-1.
The Ctrl-1 or Shift-Ctrl-1 in not work for me... And not work with the ' key ( near the K-L-; ) when I switch to English keyboard layout...
And I can not find such function in my Shortcut key list of LO 4.4.7...

Where can I find this function from the menu?
 Edit: Ahhh, it works - with English keyboard layout - in my LO 5.3.0 Portable version...
And the name of the function is: 'Fill single edit'. I can assign this function to a really available shortcut key now in my Hungarian LO 4.4.7 too. 
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
jbergx53
Posts: 4
Joined: Wed Mar 22, 2017 10:47 pm

Re: Control apostrophe

Post by jbergx53 »

I have tried setting up a macro in CALC to replicate the cell above it, but have not been able to do this with a CTRL-' as is standard in EXCEL. I hope that the systems programmers that have given us the great capabilities of Open Office will see fit to make this a basic part of CALC.
Open Office 4.1.1 - Windows 10
User avatar
Zizi64
Volunteer
Posts: 11352
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Control apostrophe

Post by Zizi64 »

When you have wrote (or recorded) a macro subroutine, and stored it into a Module of the MyMacros/Standard directory, then you can assogn the subroutine to a Menu item, or to a Hotkey (shortcut key) or to a Toolbar icon. Use the Customize function from the
Tools - Customize...

Here is a very simple, recorded macro:

Code: Select all

sub Copy_Down
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(1) as new com.sun.star.beans.PropertyValue
args1(0).Name = "By"
args1(0).Value = 1
args1(1).Name = "Sel"
args1(1).Value = false

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

rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Copy", "", 0, Array())

rem ----------------------------------------------------------------------
dim args3(1) as new com.sun.star.beans.PropertyValue
args3(0).Name = "By"
args3(0).Value = 1
args3(1).Name = "Sel"
args3(1).Value = false

dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, args3())

rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Paste", "", 0, Array())


end sub
What is your Locale, and what keyboard layout are you using (where is the aphostrophe key on your keyboard)?
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
Zizi64
Volunteer
Posts: 11352
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Control apostrophe

Post by Zizi64 »

Here is an example file. The macro code is in the document. You need copy the macro code into the MyMacros/Standard directory if you want use it in all of your documents.
The button will launch the macro in this document.
You must customize your AOO: assign the macro from the MyMacros to the ' (apostrophe) key of the English keyboard layout.

The macro checks the type of the cell content of the above cell, and will copy the content based of the type value.
http://www.openoffice.org/api/docs/comm ... tType.html
CopyDown.ods
(12.88 KiB) Downloaded 385 times

Code: Select all

sub CopyDown

	oSheet = thiscomponent.getcurrentcontroller.activesheet
	oCellActual = ThisComponent.getCurrentSelection()
	oCellAddress = oCellActual.getCellAddress()
	iRow = oCellAddress.Row()
	iCol = oCellAddress.Column()
	oCellAbove = oSheet.getCellByPosition(iCol,iRow-1)

	Select Case oCellAbove.Type
		Case 0
			oCellActual.ClearContents(1 OR 2 OR 4 OR 8 OR 16 OR 32 OR 64 OR 128 OR 256 OR 512)
		Case 1
			oCellActual.Value = oCellAbove.Value
		Case 2
			oCellActual.String = oCellAbove.String
		Case 3
			oCellActual.Formula = oCellAbove.Formula
	End select
end sub
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Post Reply