title: Convert VBA Simple Macro to LibreOffice Macro
body: <p>I have the following macro, which takes a sparse set of data and copies the only entry from each row into the left-most column. <a href="https://i.stack.imgur.com/vwtzo.jpg" rel="nofollow noreferrer">Example of data</a></p>
  
  <p>I am hoping someone could rewrite this macro into one that will work with the same data in LibreOffice.</p>
  
  <pre><code>Sub Macro1()
  
      Dim rng As Range
  
      Set rng = Selection
  
  
      For Each row In rng.Rows
          For Each cell In row.Cells
              If cell &lt;&gt; "" Then
                  Debug.Print cell
                  row.Cells(1) = cell
              End If
          Next
      Next
  
  End Sub
  </code></pre>
  
  <p>Example of data</p>
  
  <p>    <a href="https://i.stack.imgur.com/vwtzo.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vwtzo.jpg" alt="enter image description here"></a></p>