+ Reply to Thread
Results 1 to 13 of 13

macro to copy the formulas in Sheet2 to as many rows as rows available in Sheet1

  1. #1
    Registered User
    Join Date
    05-23-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    37

    macro to copy the formulas in Sheet2 to as many rows as rows available in Sheet1

    I need a macro to copy the formulas in Sheet2 under columnD to as many rows as rows available in Sheet1.

    Suppose if Sheet1 has entries in 12rows, then in sheet2 the formula in D1 should be copied and pasted from D2 to D12.
    Attached Files Attached Files
    Last edited by flakedew; 06-21-2012 at 03:23 AM.

  2. #2
    Forum Expert
    Join Date
    09-27-2011
    Location
    Poland
    MS-Off Ver
    Excel 2007
    Posts
    1,312

    Re: macro to copy the formulas in Sheet2 to as many rows as rows available in Sheet1

    Hi try this
    Please Login or Register  to view this content.
    Regards

    tom1977

    If You are satisfied with my solution click the small star icon on the left to say thanks.

  3. #3
    Registered User
    Join Date
    05-23-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    37

    Re: macro to copy the formulas in Sheet2 to as many rows as rows available in Sheet1

    Thanx for your response..
    Sorry, I didnt put it right in the first instance.

    In Sheet1 the data entry starts from B9.
    In sheet 2 the formulas from A3:U3 should be copied and pasted from A4:U4 to number of rows as per count of rows from B9 of Sheet1.

    Please help.

  4. #4
    Registered User
    Join Date
    05-23-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    37

    Re: macro to copy the formulas in Sheet2 to as many rows as rows available in Sheet1

    Thanx for your response..
    Sorry, I didnt put it right in the first instance.

    I have revised the sample file

    In Sheet1 the data entry starts from B9.
    In sheet 2 the formulas from A3:U3 should be copied and pasted from A4:U4 to number of rows as per count of rows from B9 of Sheet1.

    Please help.
    Last edited by flakedew; 06-21-2012 at 03:24 AM.

  5. #5
    Forum Expert
    Join Date
    09-27-2011
    Location
    Poland
    MS-Off Ver
    Excel 2007
    Posts
    1,312

    Re: macro to copy the formulas in Sheet2 to as many rows as rows available in Sheet1

    Could You upload sample with all changes You have said above?

  6. #6
    Registered User
    Join Date
    05-23-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    37

    Re: macro to copy the formulas in Sheet2 to as many rows as rows available in Sheet1

    Sample file is attached for your reference please
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    09-27-2011
    Location
    Poland
    MS-Off Ver
    Excel 2007
    Posts
    1,312

    Re: macro to copy the formulas in Sheet2 to as many rows as rows available in Sheet1

    Sorry I do not understand this
    In sheet 2 the formulas from A3:U3 should be copied and pasted from A4:U4

  8. #8
    Registered User
    Join Date
    05-23-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    37

    Re: macro to copy the formulas in Sheet2 to as many rows as rows available in Sheet1

    Suppose in Sheet1 from row B9 there are entries upto B13,(total rows :5), then in Sheet2, select A3:U3, copy and paste from A4:U4 to A7:U7

    From B1 to B8 in sheet1 it contains Header. Actual data entry starts from B9.

  9. #9
    Forum Expert
    Join Date
    09-27-2011
    Location
    Poland
    MS-Off Ver
    Excel 2007
    Posts
    1,312

    Re: macro to copy the formulas in Sheet2 to as many rows as rows available in Sheet1

    Ok take a look at this and tell me is it ok?
    Please Login or Register  to view this content.
    Of course first clear the range A4:U13 in sheet2 to see how this code works

  10. #10
    Registered User
    Join Date
    05-23-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    37

    Re: macro to copy the formulas in Sheet2 to as many rows as rows available in Sheet1

    Sorry.. it did nt work.
    the available formulas in A3:U3 got changed.

  11. #11
    Forum Expert
    Join Date
    09-27-2011
    Location
    Poland
    MS-Off Ver
    Excel 2007
    Posts
    1,312

    Re: macro to copy the formulas in Sheet2 to as many rows as rows available in Sheet1

    Look into attachment run code and check results (if it is not what you expected then make manually this what you need and send this back)
    Attached Files Attached Files
    Last edited by tom1977; 06-21-2012 at 04:28 AM.

  12. #12
    Registered User
    Join Date
    05-23-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    37

    Re: macro to copy the formulas in Sheet2 to as many rows as rows available in Sheet1

    In the sample file attached, in sheet1, B8 contains Header, data entry starts from B9. there are total 11 entries.
    In sheet2, Row A1 contains header, Row A2 is blank, RowA3:C3 contains formulas to pick data from Sheet1 and from C4:U4 some calculation formulas.
    A3:U3 should be copied and pasted from A4:U4 to A13:U13 {10entries ( since the total entries in Sheet1 is 11 and already we have one entry in A3)}

    the present code paste only A4:A12.
    Attached Files Attached Files

  13. #13
    Forum Expert
    Join Date
    09-27-2011
    Location
    Poland
    MS-Off Ver
    Excel 2007
    Posts
    1,312

    Re: macro to copy the formulas in Sheet2 to as many rows as rows available in Sheet1

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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