+ Reply to Thread
Results 1 to 15 of 15

[Excel 2010] Extend rows based on the number of rows in another sheet

  1. #1
    Registered User
    Join Date
    06-16-2014
    Posts
    7

    [Excel 2010] Extend rows based on the number of rows in another sheet

    Good day to everyone,

    I'm a beginner in VBA and even after looking into it, I don't find any solution allowing me to calculate the number of full rows in one data base located on one sheet X to determine how many rows the macro needs to extend on sheet B (sheet B is made only of formulas for data interpretation in sheet A.

    I know this should be fairly simple for you guys but I don't know how to compile this.

    Any help would be greatly appreciated, please let me know if any further details are needed.

    Thank you.

  2. #2
    Valued Forum Contributor
    Join Date
    11-02-2012
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    564

    Re: [Excel 2010] Extend rows based on the number of rows in another sheet

    calculate the number of full rows
    By that, you mean who many rows in a column are used? equal to counting non-blank cells in a column. Or what is the number of rows between first row and last row used in a column. Or a row in which all the columns are filled?

  3. #3
    Registered User
    Join Date
    06-16-2014
    Posts
    7

    Re: [Excel 2010] Extend rows based on the number of rows in another sheet

    Good day haripopuri,

    Thank you for helping me to clarify my request.

    Sheet A is made of a database, which will be updated 2 to 3 times a week, sheet B is made of formulas who will rework the datas provided in sheet A.

    So I would like the macro when I click it to count the number of rows that are filled in column A in sheet A and extend the formulas included in all columns in row 1 on sheet B.

    Is that clear enough or should I rephrase it ?

    Thank you for your kind attention.

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: [Excel 2010] Extend rows based on the number of rows in another sheet

    Hi,

    If behind your request is the need to ensure that any formulae on row 1 are copied to any new rows that you add then the simplest way would be to make your database into a Table - assuming of course you have Excel 2007 or later.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  5. #5
    Registered User
    Join Date
    06-16-2014
    Posts
    7

    Re: [Excel 2010] Extend rows based on the number of rows in another sheet

    Good day Richard,

    As the database located on Sheet A is updated 2 to 3 times a week, I will integrate a delete all formulas except row 1 and 2 before proceeding to extension (Row 1 being the titles of the column, Row 2 being the formulas that needs to be extended to the number of rows included in Sheet A).

    Any chance you know how to set up the macro to count the fulfilled rows based on column A on Sheet A and extend the rows on sheet B to the variable number found in Sheet A ?

    Thank you for your greatly appreciated help.

  6. #6
    Valued Forum Contributor
    Join Date
    11-02-2012
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    564

    Re: [Excel 2010] Extend rows based on the number of rows in another sheet

    Sure. Possible to upload a sample? Can I take column A as the base to count fulfilled rows?

  7. #7
    Registered User
    Join Date
    06-16-2014
    Posts
    7

    Re: [Excel 2010] Extend rows based on the number of rows in another sheet

    Good day haripopuri,

    Please see below:

    Please Login or Register  to view this content.
    Thank you for your great help !

  8. #8
    Valued Forum Contributor
    Join Date
    11-02-2012
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    564

    Re: [Excel 2010] Extend rows based on the number of rows in another sheet

    Pls, can you upload in Excelforum. You may delete unwanted data to reduce the size.

  9. #9
    Registered User
    Join Date
    06-16-2014
    Posts
    7

    Re: [Excel 2010] Extend rows based on the number of rows in another sheet

    Noted.

    I did not see there was an option.

    Please see attachment.

    Thank you again !
    Attached Files Attached Files

  10. #10
    Valued Forum Contributor
    Join Date
    11-02-2012
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    564

    Re: [Excel 2010] Extend rows based on the number of rows in another sheet

    vbomars, thanks for honouring all the questions.
    Below code get the number of rows filled in column A from A2 (since A1 is heading) and repeat that many times to put your formula in to the cells.
    Please Login or Register  to view this content.

  11. #11
    Valued Forum Contributor
    Join Date
    11-02-2012
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    564

    Re: [Excel 2010] Extend rows based on the number of rows in another sheet

    I have hard coded sheet names. Didn't write to delete existing formulas pertains to previous run. Means, if you have formulas from last run over 30 rows, current data has only 20 rows, this macro wouldn't delete those extra 10 rows.

  12. #12
    Registered User
    Join Date
    06-16-2014
    Posts
    7

    Re: [Excel 2010] Extend rows based on the number of rows in another sheet

    haripopuri,

    Thank you for your great reply.

    The document provided was an example and in the real View on DB, I have too many formulas to input to put it in the macro I believe, it's way too complex and would be really long.

    Is there a command that would allow me to just take all formulas from row 2 and copy it down to the last row depending on the number found in DATABASE ?

    Thank you very much for your replies !

  13. #13
    Valued Forum Contributor
    Join Date
    11-02-2012
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    564

    Re: [Excel 2010] Extend rows based on the number of rows in another sheet

    Please Login or Register  to view this content.
    Make sure A2:F2 has formulas entered. You can extend column F to any other column you want. Just change the letter F in last but one line.
    Last edited by haripopuri; 06-16-2014 at 06:16 AM.

  14. #14
    Registered User
    Join Date
    06-16-2014
    Posts
    7

    Re: [Excel 2010] Extend rows based on the number of rows in another sheet

    Awesome !

    Thank you very much haripopuri !

  15. #15
    Valued Forum Contributor
    Join Date
    11-02-2012
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    564

    Re: [Excel 2010] Extend rows based on the number of rows in another sheet

    Glad I could help! update the thread as SOLVED. You may wish to add to my reputation.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 03-20-2014, 07:12 AM
  2. Replies: 3
    Last Post: 03-03-2014, 05:06 AM
  3. Pull full rows, based on one number, into another excel sheet.
    By ATowne20 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-20-2013, 04:08 PM
  4. [SOLVED] Excel VBA/Macro - Copy Number of Rows based on the number in a cell to another sheet
    By diane.alexander58 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-15-2012, 11:32 AM
  5. Extend the number of rows in the List Box
    By Excel_Kidz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-29-2011, 04:41 AM

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