How to split range of cells (only not empty) to txt file?

I would like a macro that will split the cell value by character “_” of range F5:F12 and write it to a text file.

The text file should output as shown below.

Can anyone help me write a macro? Please: D
sample.ods (9.7 KB)

  1. Always (with very few special exceptions) attach real odf (OpenDocumentFormat) files, not images!
  2. Sorry. If you can program in Basic, you will know the Split function, and how to write to a file.
    If yo not yet can program, you don’t need help, but eitther a teacher, or somebody doing the job for you. I’m afraid you will find neither the teacher nor the kind of deputy you need here.
  3. Fortunately there are books. The famous book by Andrew Pitonyak, e.g. (available from - prefer the pdf) gives an introduction to Basic, but also shows how to use the LibreOffice (same as OO.o insofar) ApplicationProgrammingInterface in Basic. Begin at the beginning.
  4. Strange: There recently was a very similar question which I can’t find just now. To you and the other guy as well I would say: Every experienced user will doubt te output format to be basically reasonable. If you want to get somebody to do the work for you, you should explain clearly for what reason the goal is sensible in your special case - and probably interestiung for others.

You can use the same macro with which you created Rozkrój from the range V21:V221. Just replace the underscores with CHAR(10) (or CHAR(10)&CHAR(13)) in your formula. It will look like


Thank you for your help JohnSun.