+ Reply to Thread
Results 1 to 7 of 7

How to update a 2nd Worksheet from another Worksheet

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    03-22-2006
    Location
    UK
    MS-Off Ver
    Office 2013
    Posts
    275

    How to update a 2nd Worksheet from another Worksheet

    Hi all

    Earlier today RoyUK supplied me with this code for updating a worksheet when a cells content changes. This works fine but I now need to have a 2nd worksheet update itself when the cell in another worksheet changes.

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Address <> "$B$2" Then Exit Sub
    ActiveSheet.Calculate
    End Sub
    To clarify, I need Worksheet1 to update itself when cell B2 in worksheet2 changes.

    TIA ...spellbound
    Last edited by Spellbound; 11-11-2008 at 08:41 PM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello Spellbound,

    What's the sheet name and the cell?

    Sincerely,
    Leith Ross

  3. #3
    Forum Contributor
    Join Date
    03-22-2006
    Location
    UK
    MS-Off Ver
    Office 2013
    Posts
    275
    Hi Leith

    Lets say worksheet1 is called Input and worksheet2 is called Results.

    So I need the Input worksheet to update itself when B2 in the Results worksheet changes.

    TIA ...spellbound

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello Spellbound,

    Change the line ActiveSheet.Calculate To Worksheets("Input")

    Sincerely,
    Leith Ross

  5. #5
    Forum Contributor
    Join Date
    03-22-2006
    Location
    UK
    MS-Off Ver
    Office 2013
    Posts
    275
    Leith

    We may be on the wrong track, I inserted the code in the Input worksheet but it did not work.

    I am using one of my test workbooks to do some evaluation work and have attached that as it may help.

    The code in the Results works fine and updates that worksheet when cell B2 changes. However for error checking purposes, I have linked this worksheet back to the Input worksheet using O2 to link the dates but I now need this worksheet to update itself when B2 in Results changes, to create the cross reference.

    TIA ...spellbound
    Attached Files Attached Files

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello Spellbound,

    Replace the macro on the Results worksheet with the code below, and remove the macro from the Input worksheet.
    Private Sub Worksheet_Change(ByVal Target As Range)
      If Target.Address <> "$B$2" Then Exit Sub
      ActiveSheet.Calculate
      Worksheets("Input").Range("$O$2") = Target
      Worksheets("Input").Calculate
    End Sub
    Sincerely,
    Leith Ross

+ 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