LibrOffice doesn’t speak VBA.
It has, however, a poweful API applicable via any programming environment having a sufficient bridge to that API.
The included Basic is poor as a language, but has a wide and short bridge. Also well supported are Python and additional languages. I don’t know anything about support for VB/VBA on this level. There only is a very limited VBA support within LibreOffice Basic which needs to be enabled explictly. I wouldn’t trust in it except for a few very well tested cases.
For me the term “extract” is very unclear. The question seems to be worded without worrying about the chance that a reader (contributor) would understand it, and even less about the time he would need. That’s bad!
IMO, it makes only sense if the contents to “extract” first are clearly defined, and the most practicable way to do it would be a FindAll
most likely based on a F&R
-likle search with a RegularExpression. You surely wouldn’ like to simply paste the complete content of the source document into a single cell of the spreadsheet, would you?
How to get what you worded “a spreadsheet” and therein the range to paste the “extracted” contents in also is substantial information that isn’t addressed.
We may assume the first sheet of a new spreadsheet document, and therein a range startung at cell A1.
Well, since I sometimes covered similar tasks, I made a demo based on my guesses concerning the vague question. Please take the needed time on the next occasion, to ask a clear question allowing for a clear answer.
See attachment.
ask253590veryVagueFindingsFromTextToSpreadsheetCells0.odt