Put TAB in a cell

Discuss the spreadsheet application

Put TAB in a cell

Postby carlmclark » Sat Apr 04, 2020 4:09 pm

Is there a way to disable the interpretation of the TAB key and let it pass through literally during cell data input?
Last edited by MrProgrammer on Sat Apr 04, 2020 4:34 pm, edited 1 time in total.
Reason: Changed subject, was: Keyboard Input Driver
OpenOffice version 4.1.3, Windows 10 Home Edition, Version 1903
carlmclark
 
Posts: 1
Joined: Sun Mar 22, 2020 3:36 pm

Re: Put TAB in a cell

Postby JohnSUN-Pensioner » Sun Apr 05, 2020 10:36 am

Why not?
You can, for example, paste a tab character in a blank document in Notepad, copy it to the clipboard, and as you type text into the cell, press Ctrl+V in the right places.
Or you can enter text in a cell as a formula of the form
Code: Select all   Expand viewCollapse view
="Two Beers"&CHAR(9)&"Or"&CHAR(9)&"Not Two Beers?"

where CHAR(9) is the tab character
This is not an exhaustive list of features, but I'm just wondering - why do you need such an opportunity?
I may not have a lot to give but what I got I'll give to you...
Apache OpenOffice 4.1.5, LibreOffice 6.4.4.2 (x64) on Windows 7
If you think that I did not answer your question, make allowances for my imperfect English
User avatar
JohnSUN-Pensioner
Volunteer
 
Posts: 824
Joined: Fri Jan 14, 2011 1:21 pm
Location: Kyiv, Ukraine

Re: Put TAB in a cell

Postby Zizi64 » Sun Apr 05, 2020 11:15 am

Here is a macro solution. Just copy/paste the macro code into MyMacros/Standard library/Module1 and then assign it the macro "cell_TAB" to a free hotkey like the Ctrl-T (or other).
The macro will insert a TAB character into the cursor position.

Code: Select all   Expand viewCollapse view
sub cell_TAB
insert_a_char(CHR(9))
end sub


'*************************************************************************

sub insert_a_char(SpecChar as string)
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 = "Text"
'args1(0).Value = SpecChar
'dispatcher.executeDispatch(document, ".uno:InsertText", "", 0, args1())
dim args2(0) as new com.sun.star.beans.PropertyValue
args2(0).Name = "Symbols"
args2(0).Value = SpecChar

dispatcher.executeDispatch(document, ".uno:InsertSymbol", "", 0, args2())
end sub
Tibor Kovacs, Hungary; LO6.1.6, 6.2.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-6.4.5;AOO4.1.7
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: 9439
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary


Return to Calc

Who is online

Users browsing this forum: No registered users and 16 guests