[Solved] Adding blank rows between rows

Discuss the spreadsheet application

[Solved] Adding blank rows between rows

Postby Lindy » Tue Jan 18, 2011 5:20 pm

I'm starting out with a 100-row spreadsheet, each row is text and unique. What is the fastest way to insert 3 blank rows between each text row? I currently select three rows, right click, and click Insert Rows, which is very time consuming. Thank you.
Last edited by Lindy on Wed Jan 19, 2011 1:34 pm, edited 1 time in total.
OpenOffice 3.1 on Windows XP
Lindy
 
Posts: 2
Joined: Tue Jan 18, 2011 5:02 pm

Re: Adding blank rows between rows

Postby MrProgrammer » Tue Jan 18, 2011 5:39 pm

In a new column immediately to the right of your data, type 0 in the first cell and fill that down (use fill handle as described in Help) to create 0, 1, 2, …, 99. In the next row (that is 101) type 0.1 and fill that down to get 0.1, 1.1, 2.1, …, 99.1. Repeat to get 0.2, 1.2, 2.2, …, 99.2 and 0.3, 1.3, 2.3, …, 99.3 in the next 200 rows. Sort the 400 rows by the new column, then delete it.

If this answered your question please go to your first post use the Edit button and add [Solved] to the start of the title. You can select the green checkmark icon at the same time.
Mr. Programmer
AOO 4.1.7 Build 9800 on MacOS 10.14.6.   The locale for any menus or Calc formulas in my posts is English (USA).
User avatar
MrProgrammer
Moderator
 
Posts: 3874
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: [Solved] Adding blank rows between rows

Postby Lindy » Wed Jan 19, 2011 1:36 pm

Pure genius, works great. Thanks a lot!
OpenOffice 3.1 on Windows XP
Lindy
 
Posts: 2
Joined: Tue Jan 18, 2011 5:02 pm

Re: [Solved] Adding blank rows between rows

Postby silvanet » Thu Nov 10, 2011 6:53 pm

This is not a solution! Doesn't anyone in this forum know how to program in VBA? How about somebody helping with a simple VBA routine that allows this to be done without all that incredible BS extra work?
OpenOffice 3.2 on Windows 7
silvanet
 
Posts: 9
Joined: Thu Dec 09, 2010 10:46 pm

Re: [Solved] Adding blank rows between rows

Postby MrProgrammer » Thu Nov 10, 2011 7:39 pm

silvanet wrote:This is not a solution!
The OP marked this as [Solved], hence it was a solution to that problem, and Lindy's response suggests that it was a good solution. Your problem is different because you want to use VBA instead of the standard user interface, and you must open a new topic. Read Don't hijack the thread of other users.
Mr. Programmer
AOO 4.1.7 Build 9800 on MacOS 10.14.6.   The locale for any menus or Calc formulas in my posts is English (USA).
User avatar
MrProgrammer
Moderator
 
Posts: 3874
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: [Solved] Adding blank rows between rows

Postby kingfisher » Fri Nov 11, 2011 1:31 am

silvanet, you should also ask that question on the Macros & API board. Before I realised you had posted in the wrong place I copied some old code. It may help you so here it is:
Code: Select all   Expand viewCollapse view
'Define the weekly table for the stock being updated, insert a row and add to table.
Dim sWStr as String, oDBase2 as Object, oCells2 as Object, lWTop as Long, lWRight as Long, _
   lWFoot as Long
sWStr = Ucase( sCode ) & "wk" : oDBase2 = vDBases.getByName( sWStr )
oCells2 = oDBase2.ReferredCells
lWFoot = oCells2.RangeAddress.EndRow + 1 : oSheet1.Rows.insertByIndex( lWFoot, 1 )
Apache OpenOffice 4.1.6 on PCLinuxOS
User avatar
kingfisher
Volunteer
 
Posts: 2120
Joined: Tue Nov 20, 2007 10:53 am

[Solved] Adding blank rows between rows

Postby AlwaysPaws » Tue Apr 19, 2016 2:46 pm

It may be five years later, but this helped me tremendously. I have a spreadsheet of over 10,000 items and needed to insert two extra rows between each row. Thank you, MrProgrammer.
Apache OpenOffice 4.1.2
OS X Yosemite version 10.10.5 (desktop)
AlwaysPaws
 
Posts: 6
Joined: Fri Feb 12, 2016 5:16 pm

Re: [Solved] Adding blank rows between rows

Postby Lupp » Wed Apr 20, 2016 2:44 pm

I have a spreadsheet of over 10,000 items and needed to insert two extra rows between each row.

I am wondering, and a bit curious now. Would you mind to tell the reasons (probably in a somehow abstract way)? From many years of using spreadsheets I cannot remeber a case of the kind.
On Windows 10: LibreOffice 6.2 and older versions, PortableOpenOffice 4.1.5 and older, StarOffice 5.2
---
Lupp from München
User avatar
Lupp
Volunteer
 
Posts: 2562
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: [Solved] Adding blank rows between rows

Postby AlwaysPaws » Thu Apr 21, 2016 8:53 pm

Hi, I am adding products that need to be in three separate categories but I only have the categories listed on one line per item. I have about 30 categories and the sheet I'm working with has the categories all mixed up because the manufacturer uses a different categorization than I want to use on my site.

In other words, using a made-up example:
Here are three categories:

Candy Lovers candy/chocolate candy
Candy Lovers candy
Chocolate candy
Apache OpenOffice 4.1.2
OS X Yosemite version 10.10.5 (desktop)
AlwaysPaws
 
Posts: 6
Joined: Fri Feb 12, 2016 5:16 pm

Re: [Solved] Adding blank rows between rows

Postby acheide » Mon Feb 18, 2019 12:26 am

I used your method to double space a list by using odd numbers and then even numbers.
Thank you MrProgrammer.
OpenOffice 4.1.6 on Windows 8.1
acheide
 
Posts: 1
Joined: Mon Feb 18, 2019 12:18 am


Return to Calc

Who is online

Users browsing this forum: No registered users and 30 guests