Can empty rows be inserted in bulk between rows that already contain data? My spreadsheet already has several hundred rows of data and I need to separate each row with an empty one. It will be a time wasting effort to do manually if there is a way to do it automatically in bulk.
You can do this via macro. With the one below, select a cell in the row you want to start with. Adjust the upper limit of the “i” variable to your needs. Paste the following code into the LO BASIC editor. With it in focus, hit F8 to step through it, or F5 to run it fully.
Save your file before using the macro!
sub Insert_rows_skipping dim document as Object dim dispatcher as object document = ThisComponent.CurrentController.Frame dispatcher = createUnoService("com.sun.star.frame.DispatchHelper") dim args1(0) as new com.sun.star.beans.PropertyValue ' args1(0).Name = "ToPoint" ' Goes to cell A1; optional ' args1(0).Value = "$A$1" ' dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args1()) dim args2(1) as new com.sun.star.beans.PropertyValue args2(0).Name = "By" args2(0).Value = 1 args2(1).Name = "Sel" args2(1).Value = false For i = 1 To 28 " This should be adjusted according to need. dispatcher.executeDispatch(document, ".uno:GoDown", "", 0, args2()) dispatcher.executeDispatch(document, ".uno:InsertRowsBefore", "", 0, Array()) args2(0).Value = 2 Next i end sub
it’s great, but how to insert blank row for each 5/6/7 row?