+ Reply to Thread
Results 1 to 10 of 10

Update function in other sheets

Hybrid View

magicool Update function in other... 02-02-2010, 04:00 AM
pike Re: Update function in other... 02-02-2010, 04:04 AM
magicool Re: Update function in other... 02-02-2010, 04:09 AM
pike Re: Update function in other... 02-02-2010, 04:53 AM
magicool Re: Update function in other... 02-02-2010, 04:59 AM
pike Re: Update function in other... 02-02-2010, 05:18 AM
magicool Re: Update function in other... 02-03-2010, 03:33 AM
pike Re: Update function in other... 02-03-2010, 04:10 AM
magicool Re: Update function in other... 02-03-2010, 04:25 AM
pike Re: Update function in other... 02-03-2010, 04:28 AM
  1. #1
    Registered User
    Join Date
    07-24-2009
    Location
    Constanta
    MS-Off Ver
    Excel 2010
    Posts
    62

    Update function in other sheets

    Hello,
    I know I can update the content of a cell on any sheet from other sheet using for example: =SHEET!$G$22. This works ok for text and numbers, but how to get the same result for a function?
    Example: in sheet1, cell B3 I have =SUM(A5:A9). When I modify in sheet1, cell B3: =SUM(A1:A9) I need his formula to change on other sheets as well. How to do that?
    Thank You!
    Last edited by magicool; 02-03-2010 at 04:25 AM.

  2. #2
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,342

    Re: Update function in other sheets

    Hi magicool
    Do you mean like....
    =SUM(Sheet1!A1:A9)
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  3. #3
    Registered User
    Join Date
    07-24-2009
    Location
    Constanta
    MS-Off Ver
    Excel 2010
    Posts
    62

    Re: Update function in other sheets

    Thank you for the reply!
    No, the formula gets its references from the sheet where it is. All I need is to have the same formula on almost all my sheets in the cell that I want. When I edit the formula in one place (sheet) the formula should also change in the other sheets.

  4. #4
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,342

    Re: Update function in other sheets

    the only way I can think of is something like......

    =SUM(INDIRECT(ADDRESS(Sheet1!G1,Sheet1!H1) &":"& ADDRESS(Sheet1!G2,Sheet1!H2)))
    where G1 G2 are the rows and H1 H2 are the columns

  5. #5
    Registered User
    Join Date
    07-24-2009
    Location
    Constanta
    MS-Off Ver
    Excel 2010
    Posts
    62

    Re: Update function in other sheets

    Thank You!
    But I used SUM just as an example.
    I tried a custom function:
    Function GetFormula(Cell as Range) as String
       GetFormula = Cell.Formula
    End Function
    but it just displays the formula in the cell, not the result.
    One of the formula is something like: =IF(ISERROR(VLOOKUP(A4,'S1'!$A:$C,3,0)),0,VLOOKUP(A4,'S1'!$A:$C,3,0))

  6. #6
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,342

    Re: Update function in other sheets

    or possibly
    Sub ptest()
    For Each ws In worksheets
         ws.Range("E1").Formula = "=SUM(D1:D6)"
      Next
    End Sub

  7. #7
    Registered User
    Join Date
    07-24-2009
    Location
    Constanta
    MS-Off Ver
    Excel 2010
    Posts
    62

    Re: Update function in other sheets

    Yes! This works, but it does the modification for all sheets. How to put only a range of sheets?

  8. #8
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,342

    Re: Update function in other sheets

    Hey magicool
    Try.. something like....
    Sub ptestxxxxx()
    Dim myarray,z!
    myarray = Array("Sheet2", "Sheet4") 
    For z = 0 To UBound(myarray)
         Sheets(myarray(z)).Range("E1").Formula = "=SUM(D1:D6)"
      Next
    End Sub

  9. #9
    Registered User
    Join Date
    07-24-2009
    Location
    Constanta
    MS-Off Ver
    Excel 2010
    Posts
    62

    Re: Update function in other sheets

    Yes! That is awesome! Thank you so much sir!

  10. #10
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,342

    Re: Update function in other sheets

    pike will do, your welcome and NO, thank you for the question

+ 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