Control apostrophe

Request For Enhancement, User feedback candidates for wiki

Control apostrophe

Postby jbergx53 » Wed Mar 22, 2017 11:07 pm

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
jbergx53
 
Posts: 4
Joined: Wed Mar 22, 2017 10:47 pm

Re: Control apostrophe

Postby RusselB » Wed Mar 22, 2017 11:20 pm

OpenOffice 4.1.4 and LibreOffice 5.2.7.2 on Windows 7 Pro & Ultimate
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.
RusselB
Volunteer
 
Posts: 4121
Joined: Fri Jan 03, 2014 7:31 am
Location: Sarnia, ON

Re: Control apostrophe

Postby Zizi64 » Wed Mar 22, 2017 11:21 pm

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   Expand viewCollapse view
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; LO4.4.7, LO5.3.7 on Win7x64Prof.
PortableApps, WinPenPack: LO3.3.0-LO5.4.2 and AOO4.1.3
Please, edit the topic's initial post, and add the word "[Solved]" at the beginning of the subject line - if your problem has been solved.
User avatar
Zizi64
Volunteer
 
Posts: 6008
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Control apostrophe

Postby acknak » Wed Mar 22, 2017 11:51 pm

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
User avatar
acknak
Moderator
 
Posts: 22662
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Control apostrophe

Postby jbergx53 » Thu Mar 23, 2017 1:04 am

Thank you both, Zizi64 and acknak!
Open Office 4.1.1 - Windows 10
jbergx53
 
Posts: 4
Joined: Wed Mar 22, 2017 10:47 pm

Re: Control apostrophe

Postby Zizi64 » Thu Mar 23, 2017 7:32 am

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; LO4.4.7, LO5.3.7 on Win7x64Prof.
PortableApps, WinPenPack: LO3.3.0-LO5.4.2 and AOO4.1.3
Please, edit the topic's initial post, and add the word "[Solved]" at the beginning of the subject line - if your problem has been solved.
User avatar
Zizi64
Volunteer
 
Posts: 6008
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Control apostrophe

Postby jbergx53 » Thu Mar 23, 2017 6:56 pm

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
jbergx53
 
Posts: 4
Joined: Wed Mar 22, 2017 10:47 pm

Re: Control apostrophe

Postby Zizi64 » Thu Mar 23, 2017 7:52 pm

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   Expand viewCollapse view
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; LO4.4.7, LO5.3.7 on Win7x64Prof.
PortableApps, WinPenPack: LO3.3.0-LO5.4.2 and AOO4.1.3
Please, edit the topic's initial post, and add the word "[Solved]" at the beginning of the subject line - if your problem has been solved.
User avatar
Zizi64
Volunteer
 
Posts: 6008
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Control apostrophe

Postby Zizi64 » Thu Mar 23, 2017 10:12 pm

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 47 times


Code: Select all   Expand viewCollapse view
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; LO4.4.7, LO5.3.7 on Win7x64Prof.
PortableApps, WinPenPack: LO3.3.0-LO5.4.2 and AOO4.1.3
Please, edit the topic's initial post, and add the word "[Solved]" at the beginning of the subject line - if your problem has been solved.
User avatar
Zizi64
Volunteer
 
Posts: 6008
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary


Return to User Experience (UX)

Who is online

Users browsing this forum: No registered users and 1 guest