+ Reply to Thread
Results 1 to 17 of 17

Copy formula to reference next worksheet

Hybrid View

  1. #1
    Registered User
    Join Date
    05-16-2004
    Posts
    22

    Copy formula to reference next worksheet

    Hello,

    I have my inventory based in excel. Each brand has it's own file. Each file has several worksheets with all of the items, prices, etc. on them. When I get a shipment, I fill out the next worksheet in line. This way- I have a record of my inventory and a worksheet for each shipment. It has been working very well. The first worksheet in each file is a summary page that shows me the grand totals, shipping charge, etc. from each filled in worksheet page. the problem is I have to build that summary page for each worksheet I fill in.

    I would like a way to tell excel to give the same information as I requested in the previous row, but the next worksheet down.

    Any Ideas?

    Thank You!
    --Seth

  2. #2
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by MAGICofSeth
    Hello,

    I have my inventory based in excel. Each brand has it's own file. Each file has several worksheets with all of the items, prices, etc. on them. When I get a shipment, I fill out the next worksheet in line. This way- I have a record of my inventory and a worksheet for each shipment. It has been working very well. The first worksheet in each file is a summary page that shows me the grand totals, shipping charge, etc. from each filled in worksheet page. the problem is I have to build that summary page for each worksheet I fill in.

    I would like a way to tell excel to give the same information as I requested in the previous row, but the next worksheet down.

    Any Ideas?

    Thank You!
    --Seth
    Hi,

    a small macro like
    Sub BuildIndex()
    Dim i As Long
    Dim iTo As Long
    iTo = Worksheets.Count
    For i = 1 To iTo
        Range("A" & i + 5) = i
        Range("B" & i + 5) = Sheets(i).Name
        Next
        Range("C6:C" & iTo + 5).Formula = "=Indirect(B6&""!B5"")"
        Range("D6:D" & iTo + 5).Formula = "=Indirect(B6&""!E7"")"
        Range("E6:E" & iTo + 5).Formula = "=Indirect(B6&""!F12"")"
    
    End Sub
    would do that, just amend the B5 E7 and F12 etc as required.

    hth
    ---
    Last edited by Bryan Hessey; 02-20-2007 at 06:58 PM.
    Si fractum non sit, noli id reficere.

  3. #3
    Registered User
    Join Date
    05-16-2004
    Posts
    22

    Here is one of my files to see an example...

    This is a file for one brand. You will be able to see how each row's formulas relate to a worksheet.

    Each row down relates to the next worksheet in line.
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by MAGICofSeth
    This is a file for one brand. You will be able to see how each row's formulas relate to a worksheet.

    Each row down relates to the next worksheet in line.
    Hi,

    I presume that you are looking to pickup totals from the sheets relative to the "Total Ret." cell, in which case if you replace the formula in K2,3,4 from

    ='I-51809'!H120
    ='I-52357'!H119
    =inv3!H117

    to

    =INDEX('I-51809'!A:L,MATCH("Total Ret.",'I-51809'!H:H,0)+3,8)
    =INDEX('I-52357'!A:L,MATCH("Total Ret.",'I-52357'!H:H,0)+3,8)
    =INDEX(inv3!A:L,MATCH("Total Ret.",inv3!H:H,0)+3,8)

    and if you clean-up B4 you can use

    =INDEX(INDIRECT("'"&B2&"'!A:L"),MATCH("Total Ret.",INDIRECT("'"&B2&"'!H:H"),0)+3,8)

    and formula fill that down the K column.

    Similar would work for other columns also.

    hth
    ---

  5. #5
    Registered User
    Join Date
    05-16-2004
    Posts
    22

    Thank you

    Thank you very much.

    I cleaned up B4 and used the formula fill. It worked GREAT!

    Would you mind giving me just one more of the same formula fill but with another column? Then I'll see what to change and be able to make my own formula fills for each column. It will be exactly what I need.

    Thank you very, very much again!
    --Seth

  6. #6
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by MAGICofSeth
    Thank you very much.

    I cleaned up B4 and used the formula fill. It worked GREAT!

    Would you mind giving me just one more of the same formula fill but with another column? Then I'll see what to change and be able to make my own formula fills for each column. It will be exactly what I need.

    Thank you very, very much again!
    --Seth
    Hi,

    =INDEX(INDIRECT("'"&B2&"'!A:L"),MATCH("Total Ret.",INDIRECT("'"&B2&"'!H:H"),0)+3,8)

    which 'other column'? (I wish I could remember what this formula did)

    =INDEX(INDIRECT("'"&B2&"'!A:L"),MATCH("Total Ret.",INDIRECT("'"&B2&"'!H:H"),0)+3,8)


    MATCH("Total Ret.",INDIRECT("'"&B2&"'!H:H"),0)

    looks for 'Total Ret.' in column H of the sheet noted in cell B2, change B2 for another Sheetname, change H:H to find 'Total Ret/' in another column

    =INDEX(INDIRECT("'"&B2&"'!A:L"), row +3,8)

    column 8 = H - change to 9 for I etc.

    does this help?
    ---

  7. #7
    Registered User
    Join Date
    05-16-2004
    Posts
    22

    Different WorkSheet Name in this Sheet's Cell

    Hello,

    I found a formula to put the name of the current worksheet into a cell. It is as follows:

    =MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,256)

    It is almost perfect. I would like the name of the next sheet in line to be returned instead of the current sheet.

    Any ideas?

    Thank you very much,
    --Seth

  8. #8
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Hi,

    You can use code to do this. This link should help

    http://www.cpearson.com/excel/sheetref.htm

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  9. #9
    Registered User
    Join Date
    05-16-2004
    Posts
    22

    One more step.

    This code works great for returning the next sheet name. Can a modifier be added to show the next, next sheet?

    Then the next,next,next sheet?

    The code in the cell looks like:

    =NextSheetName()

    Can I do something like =NextSheetName() +1
    =NextSheetName() +2

    That is obviously not working, but my ultimate goal is to be able to drag the formula down my column, and as it completes itself, the next sheet name, and then the following sheet name, and so on fills the column.

    Thank you very much!!
    --Seth

  10. #10
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Why don't you explain what you are trying to achieve.

    That way someone might come up with a better solution

    VBA Noob

  11. #11
    Registered User
    Join Date
    05-16-2004
    Posts
    22

    What I am trying to accomplish

    I have attached a file for reference.

    I would like to be able to grab the bottom right corner of cell B2, and drag down the B column. The automatic fill would put in the names of the many sheets in the spreadsheet. When I add another sheet, I would be able to automatically fill in the new sheet's name in the next cell down in column B.

    This comes from an excellent formula that fills in all the other cells data based on the information from Column B. Now I am looking for a way to automatically fill the cells in Column B.

    Please see the attached file for a better explanation.

    Thank you all very much for your help!
    --Seth
    Attached Files Attached Files

+ 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