We're aware that some users are experiencing technical issues which the team are working to resolve. See the Community Noticeboard for more info. Thank you for your patience.
📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!

Excel help please (very simple q I suspect)

Options
TIA for reading.

I have a spreadsheet with a long list of client names and associated data.

I want to add 3 blank rows after each client. I'm sure there must be a REALLY easy way to do this, but can anyone tell me what it is?

Thanks folks!
Ex board guide. Signature now changed (if you know, you know).
«1

Comments

  • RichardD1970
    RichardD1970 Posts: 3,796 Forumite
    Part of the Furniture 1,000 Posts Name Dropper
    Right click on the header bar (where it says 1,2,3/A,B,C etc) where you want the new row and click insert.
  • jobbingmusician
    jobbingmusician Posts: 20,347 Forumite
    Part of the Furniture 10,000 Posts Name Dropper
    Thank you. But can I insert 3 rows after every client at once?
    Ex board guide. Signature now changed (if you know, you know).
  • EchoLocation
    EchoLocation Posts: 901 Forumite
    Part of the Furniture 500 Posts Combo Breaker
    Use the following macro.
    Sub InsertRows()
    For i = ActiveSheet.UsedRange.Rows.Count To 1 Step -1
    For j = 0 To 2
    ActiveSheet.Rows(i).Insert
    Next
    Next
    End Sub
  • jobbingmusician
    jobbingmusician Posts: 20,347 Forumite
    Part of the Furniture 10,000 Posts Name Dropper
    Thank you so much! Now, I hate to ask, but how do I apply this macro to the ss?

    (I will experiment tomorrow, when I'm back at work, but have never used a macro before. I'm not totally stupid, though, and will click around until I find the macro tab - Office 2007, IIRC)
    Ex board guide. Signature now changed (if you know, you know).
  • Stompa
    Stompa Posts: 8,375 Forumite
    Part of the Furniture 1,000 Posts Name Dropper
    In an unused column next to your data, add some sequential numbers (so if you have 10 rows, 1 to 10). Below that in the same column add 1.1,2.1,...,10.1. Below that 1.2,2.2,...,10.2, then below that 1.3,2.3,...,10.3. Autofill will let you do that easily:

    http://www.get-digital-help.com/2010/01/24/create-number-sequences-in-excel-2007/

    Now just sort according to this extra column, so you'll end up with:

    1 your data row 1
    1.1
    1.2
    1.3
    2 your data row 2
    2.1
    2.2
    2.3
    3 your data row 3
    etc...

    then delete the column to which you've added these numbers.
    Stompa
  • EchoLocation
    EchoLocation Posts: 901 Forumite
    Part of the Furniture 500 Posts Combo Breaker
    First check to see if you have the Developer Tab at the top of your screen (it's usually after the View Tab). If not, click on the Office button and then 'Excel Options'. Select 'Popular ' on the left, then on the right tick the option for 'Show Developer Tab in the Ribbon'. OK.

    Click on the Developer Tab then on 'Visual Basic' amongst the Code options.

    In the Left Hand Pane you should see your file with an expand/collapse tree.

    Expand the project until you see 'ThisWorkBook'.
    Right Click on it and select Insert... Module.
    You should then see a Module1 appear underneath

    Paste the Macro code into the main blank workspace window then close Visual Basic Editor down as normal (don't worry it won't close your Excel workbook as well).

    Go back on the worksheet you want to run the macro.
    On the Developer Tab click 'Macros' amongst the Code options.
    Select the Macro 'InsertRows' listed and then click 'Run'

    See here http://grok.lsu.edu/Article.aspx?articleId=538


    Depending on the length of your data this might take a while. I also haven't switched the screen update off so you will be able to see it running.

    If your data is really long you might be waiting some time. I would also advise making a copy of your file beforehand - not because this should mess anything up, but just incase. Perhaps use it on a small test file of a few records first to ensure it does what you want.
  • jobbingmusician
    jobbingmusician Posts: 20,347 Forumite
    Part of the Furniture 10,000 Posts Name Dropper
    Lovely, thank you all (especially Echo, as I think this is going to work). I'll update tomorrow, when I've had a chance to try it on the data :D
    Ex board guide. Signature now changed (if you know, you know).
  • jobbingmusician
    jobbingmusician Posts: 20,347 Forumite
    Part of the Furniture 10,000 Posts Name Dropper
    Oooo, on re-reading, I think Stompa's solution is a lovely Heath Robinson one. Why didn't I think of that! :D

    But I will learn more from Echo's solution, so will try that first. :A
    Ex board guide. Signature now changed (if you know, you know).
  • jobbingmusician
    jobbingmusician Posts: 20,347 Forumite
    Part of the Furniture 10,000 Posts Name Dropper
    First check to see if you have the Developer Tab at the top of your screen (it's usually after the View Tab). If not, click on the Office button and then 'Excel Options'. Select 'Popular ' on the left, then on the right tick the option for 'Show Developer Tab in the Ribbon'. OK.

    Click on the Developer Tab then on 'Visual Basic' amongst the Code options.

    In the Left Hand Pane you should see your file with an expand/collapse tree.

    Expand the project until you see 'ThisWorkBook'.
    Right Click on it and select Insert... Module.
    You should then see a Module1 appear underneath

    Paste the Macro code into the main blank workspace window then close Visual Basic Editor down as normal (don't worry it won't close your Excel workbook as well).

    Go back on the worksheet you want to run the macro.
    On the Developer Tab click 'Macros' amongst the Code options.
    Select the Macro 'InsertRows' listed and then click 'Run'

    See here http://grok.lsu.edu/Article.aspx?articleId=538


    Depending on the length of your data this might take a while. I also haven't switched the screen update off so you will be able to see it running.

    If your data is really long you might be waiting some time. I would also advise making a copy of your file beforehand - not because this should mess anything up, but just incase. Perhaps use it on a small test file of a few records first to ensure it does what you want.

    woooooooooooooo! It worked! MANY thanks for showing me more than I have ever seen before about the potential of Excel. :D:D:D
    Ex board guide. Signature now changed (if you know, you know).
  • EchoLocation
    EchoLocation Posts: 901 Forumite
    Part of the Furniture 500 Posts Combo Breaker
    woooooooooooooo! It worked! MANY thanks for showing me more than I have ever seen before about the potential of Excel. :D:D:D

    No problem - pretty much anything is possible.

    And don't worry, I must admit I didn't think of Stompa's solution either!
This discussion has been closed.
Meet your Ambassadors

🚀 Getting Started

Hi new member!

Our Getting Started Guide will help you get the most out of the Forum

Categories

  • All Categories
  • 350.9K Banking & Borrowing
  • 253.1K Reduce Debt & Boost Income
  • 453.5K Spending & Discounts
  • 243.9K Work, Benefits & Business
  • 598.8K Mortgages, Homes & Bills
  • 176.9K Life & Family
  • 257.2K Travel & Transport
  • 1.5M Hobbies & Leisure
  • 16.1K Discuss & Feedback
  • 37.6K Read-Only Boards

Is this how you want to be seen?

We see you are using a default avatar. It takes only a few seconds to pick a picture.