+ Reply to Thread
Results 1 to 5 of 5

How to copy formula across multiple worksheets but in different cell locations?

  1. #1
    Registered User
    Join Date
    07-09-2015
    Location
    Chicago
    MS-Off Ver
    Excel 2013
    Posts
    3

    How to copy formula across multiple worksheets but in different cell locations?

    I have a formula on Sheet1/cell D330 and I want to paste the exact formula across several worksheets at once. Although every worksheet will need this formula in column D, the row will be different for every worksheet (which is why I can’t simply highlight all worksheets simultaneously and copy/paste). On each worksheet, the formula needs to go after the last populated cell in column D.

    For example, I need the same formula from Sheet1/cell D330 pasted to Sheet2/cell D202 and Sheet3/cell D121 (because Sheet2/cell D201 and Sheet3/cell D120 are already populated with data).

    Here’s my current process, which I’m hoping can be improved upon: I put a formula on Sheet1 in cells D330, D331, D332 (different formulas in each cell). I copy rows 330, 331 and 332, then go to Sheet2 and find the last row of data (row 201), then paste into cell A202. I manually repeat the same process on Sheet3, Sheet4, etc.

    Is there a more efficient way to do this, preferably using formulas or ASAP Utilities (or another add-in), though I’m familiar with basic VBA as well. Thanks in advance!

  2. #2
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: How to copy formula across multiple worksheets but in different cell locations?

    I think the efficient way to do this is with VBA. Try the following:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    07-09-2015
    Location
    Chicago
    MS-Off Ver
    Excel 2013
    Posts
    3

    Re: How to copy formula across multiple worksheets but in different cell locations?

    Thanks for the quick reply, but I'm having trouble applying this code. I thought I could provide a general idea of my workbook setup then modify the code as needed; looks like I should have been more specific! Here's my exact current process, would appreciate your help trying to adapt the VBA:

    On sheet "AA", I put the following new data in the specified cells:
    A330: "January" | B330: "2016" | C330: =C329*(1+(D330/100)) | D330: =VLOOKUP(REPLACE(CELL("filename",$A$1),1,FIND("]",CELL("filename",$A$1)),""),Mnthly,4,0)
    A331: "February" | B331: "2016" | C331: =C330*(1+(D331/100)) | D331: =VLOOKUP(REPLACE(CELL("filename",$A$1),1,FIND("]",CELL("filename",$A$1)),""),Mnthly,5,0)
    A332: "March" | B332: "2016" | C332: =C331*(1+(D332/100)) | D332: =VLOOKUP(REPLACE(CELL("filename",$A$1),1,FIND("]",CELL("filename",$A$1)),""),Mnthly,6,0)

    Now sheet AA is complete. I copy rows 330, 331 and 332, then go to the next sheet named "NHYF" and find the last row of data (row 201), then paste the three rows starting in cell A202. I manually repeat the same process for the next 103 sheets, which each have different names (I have another sheet called "Code Listing" with all the tab names in one column if that helps). And 3 months from now, in early July, I'll update each sheet with the next three months of data: sheet AA, I'll start in cell A333: "April", etc, etc.

    I hope this is clear. Thanks again for the help!

  4. #4
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: How to copy formula across multiple worksheets but in different cell locations?

    Give the procedure below a try. It should take A:D of the last three rows on the first sheet and copy them to A:D at the end of every subsequent sheet. Let me know how it works...

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    07-09-2015
    Location
    Chicago
    MS-Off Ver
    Excel 2013
    Posts
    3

    Re: How to copy formula across multiple worksheets but in different cell locations?

    Quote Originally Posted by cantosh View Post
    Give the procedure below a try. It should take A:D of the last three rows on the first sheet and copy them to A:D at the end of every subsequent sheet. Let me know how it works...

    Please Login or Register  to view this content.
    This worked perfectly, thank you very much! Saved me lots of time and potential human error, and I learned a bit more about VBA.

+ 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: 01-22-2016, 08:03 PM
  2. [SOLVED] Copy multiple files to multiple locations
    By dizzidecazz in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-09-2015, 10:01 AM
  3. Create a master file from multiple worksheets using cell locations
    By ellisgirl in forum Excel - New Users/Basics
    Replies: 0
    Last Post: 01-26-2015, 05:31 PM
  4. Most efficient way to copy multiple variables to specific cell locations using offset
    By joshnathan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-22-2014, 07:18 AM
  5. Replies: 1
    Last Post: 05-07-2013, 02:49 PM
  6. Replies: 4
    Last Post: 08-02-2010, 07:16 AM
  7. Replies: 2
    Last Post: 01-15-2006, 09:45 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