AutoInput more than one entry

So I love how LibreOffice Calc has a feature where if I already typed a word in a higher row, a highlighted suggestion pops up containing the previous entry.

Only problem is, I keep having to double click each cell and hit space to make them pop up. I’m translating a story, so there is a lot of words; my fingertips are beginning to hurt. Is there a way to make them autofill the same way, but all at once? Like, in a bulk operation that doesn’t require clicking on each cell and hitting space.

Thanks!

EDIT:
Annotation 2022-05-12 064128
To be more clear, Calc AutoInput automatically fills in the English translation in the above example once the French-English pair has been entered. One only needs to paste the French word (chat) and hit space, and the English translation (cat) pops up (the highlighted word). (cont.)

Please, share a reduced sample file to test. Thanks.
Maybe VLOOKUP could help.

F2 does the same as double-clicking.
Apart from that, I don’t have the faintest idea what you are trying to do.

Ok, well I guess I’ll just keep clicking then!

Simple is better.

NOTE: The solution is reposted.
There was a glitch on the Ask site while updating the solution, and earlier posts joined in.

Here’s an example using @LeRoyG’s VLOOKUP.

Please note that from the perspective of an experienced user, this is just not the right way to go about the ultimate goal, but if the pattern is working, then perhaps it’s good enough.

SimulateAutoEntry.ods (31.2 KB)

1 Like

NOTE: There was a glitch on the Ask site while updating the solution, and earlier posts joined in.
Let’s deal with the error more thoroughly. I have no error.

But this is AutoInput! We have to start entering…

For me, it is easier to press F2.

@eeigor,
The AutoInput works if with a macro you edit a cell, then add a space and Enter?

Select cell B6 and translate the word from the left (“et”).
Move the cursor to the left (select cell A6).
Then run the code. But errors are handled. :face_with_monocle:
I updated the file.

F2, Space. This is for AutoInput (menu Tools).

File has been updated. Adding the selected word to the vocabulary by a hyperlink is implemented.

Where does the word translation come from? I also want it to translate itself.

We need to decide what to do with the existing entries in the vocabulary. Update it by replacing the current translation with the new value? Or add a new meaning of the word via a semicolon?

NOTE: The solution is reposted due to an Ask glitch.
Try this.
vocabulary.ods (27.1 KB)
Updated. Edit: See below for ‘vocabulary (2).ods’ & for ‘vocbulary (3).ods’ .

The regular expression has been changed to correctly split compound words containing a hyphen.
Regex Pattern: "[\W]+" to "[^\w||-]+"
OR: '"[\W---]", "[\W--[-]]", "[\W&&[^-]]"
To my surprise, Calc handles this expressions.


Important! Macros must be enabled. Menu: Options -LibreOffice - Security - Macro Security… - Security Level
Actions:

  1. Clear range A3:B12.
  2. Select cell A2. Double-click the cell. OR:
    Alt+F11: Select Standard.MainProcs.TranslateTextByWords procedure from existing macros of 'Vocabulary.ods’ and run it. Close the dialog.
  3. Select cell B6 and translate the word from the left (“et”).
  4. Move the cursor to the left (select cell A6).
  5. Alt+F11: Select Standard.MainProcs.AddWordToVocabulary procedure from existing macros of 'Vocabulary.ods’ and run it. Close the dialog.

Notes:

  1. The vocabulary allows the inclusion of duplicates (including characters of different case).
  2. If you add a word that is already in the vocabulary, it will also be added. If necessary, you can change this behavior and implement an update of an existing word in the dictionary.
  3. After adding a new word, the vocabulary will be sorted by the left column.
  4. Perhaps another things should be implemented.
    • The rows under the words should be inserted (not added), shifting the existing data down.
    • The double-click action can be limited, for example, to the first column. — Edit: DONE.

    @Frederico2, I have no errors. Follow the instructions clearly. The code is written quite thoroughly, but there may be exceptions.

add-selected-word-to-vocabulary
vocabulary (2).ods (27.4 KB)

Edit 2:

vocabulary (3).ods (28.6 KB)

The attached file is updated. The double-click action is limited to the first column (Translate.A:A).

Still, why don’t you want to keep the word and the translation of the word in separate cells of the row? This is the right approach, and the solution is already given to you. And AutoInput is for individual value.

And you can add the source word to the translation.

And as always: This is a database job.

@Villeroy Not, if he insist to have both languages in the same cell/field…

1 Like
  1. Select the column.
  2. Do: Menu: Data - Text to Columns… (split by space).

Yes. That’s what @Lupp did in your topic that you linked to here somewhere.
This can be changed by editing the regular expression in the SplitText() function.
sPattern = "[^\w||-]+" << Regex pattern is set here
(OR: "[\W--[-]]", "[\W---]", "[\W&&[^-]]")
How would you like to handle punctuation marks?
They are now being completely removed.


Edit:
The attached file is updated. Look for ‘vocabulary (3).ods’.

The vocabulary does not allow the inclusion of duplicates (insensitive to case) now.
If you add a word that is already in the vocabulary, you will be prompted to edit the meaning(s) of the word yourself.