+ Reply to Thread
Results 1 to 5 of 5

Macro to insert blank rows so that the total number of rows with data is equal to 1021

  1. #1
    Registered User
    Join Date
    03-05-2013
    Location
    Bristol, UK
    MS-Off Ver
    Excel 2007
    Posts
    3

    Macro to insert blank rows so that the total number of rows with data is equal to 1021

    Hi there,

    I have a total number of 263 sheets in my Excel file. Each sheet has a different number of rows with data. Could anyone please help me create a macro that can insert the blank rows from the top so that the total number of rows (including the blank rows) is equal to 1021.

    Many thanks in advance.

    Best,

    N
    Last edited by nsm1411; 03-07-2013 at 10:24 AM.

  2. #2
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Macro to insert blank rows so that the total number of rows with data is equal to 1021

    Perhaps a macro like this?

    Please Login or Register  to view this content.
    As this macro is based on a guess as you have not specified how your data is organized in the different sheets I recomend that you backup your data before testing the macro

    Alf
    Last edited by Alf; 03-07-2013 at 03:14 AM.

  3. #3
    Registered User
    Join Date
    03-05-2013
    Location
    Bristol, UK
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Macro to insert blank rows so that the total number of rows with data is equal to 1021

    Dear Alf,

    Thank you very much for your help! The macro works perfectly!

    Best,

    N

  4. #4
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Macro to insert blank rows so that the total number of rows with data is equal to 1021

    Glad to be of help and thanks for feed back. You should be aware of the limitations of this macro i.e. assuming your data goes from row 1 to row 25 but row 3 is empty then the command
    Please Login or Register  to view this content.
    will be 24 not 25 as row 3 is empty and therefore "not used".

    As this seems to take care of your problem could you please sign your thread "Solved" and if you like to give a rating to my answer click on the small star in my post (bottom left).

    Alf

    To mark your thread solved do the following:
    - Go to the first post
    - Click edit
    - Click Advance
    - Just below the word "Title:" you will see a dropdown with the word No prefix.
    - Change to Solve
    - Click Save

  5. #5
    Registered User
    Join Date
    03-05-2013
    Location
    Bristol, UK
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Macro to insert blank rows so that the total number of rows with data is equal to 1021

    Just did that. Thanks again

    N

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1