+ Reply to Thread
Results 1 to 18 of 18

mirror data between cells in different worksheets

  1. #1
    Registered User
    Join Date
    07-03-2010
    Location
    Charlotte USA
    MS-Off Ver
    Excel 2003
    Posts
    5

    Smile mirror data between cells in different worksheets

    Hi

    I am trying to find a way of linking 2 cell in different worksheet together so that when the data in one changes the others mirrors it and visa versa.
    eg.

    When the data in Sheet1 A1:A20 changes it is mirrored in Sheet2 B10:B30
    and then when data in Sheet2 B10:B30 is changed it is mirrored in Sheet1 A1:A20

    Any suggestions would be very much appreciated.

    Thanks

  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,258

    Re: mirror data between cells in different worksheets

    Hello dumdum,

    Welcome tot he Forum!

    Do the cells change because of user input or because of formulas?
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    07-03-2010
    Location
    Charlotte USA
    MS-Off Ver
    Excel 2003
    Posts
    5

    Smile Re: mirror data between cells in different worksheets

    Hi

    Thanks for the welcome.

    I want the cells to change as a result of someone inputing the data.

    Thanks

  4. #4
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: mirror data between cells in different worksheets

    Quote Originally Posted by dumdum View Post
    When the data in Sheet1 A1:A20 changes it is mirrored in Sheet2 B10:B30
    and then when data in Sheet2 B10:B30 is changed it is mirrored in Sheet1 A1:A20
    Put this code in Sheet1 Module (Right Mouse Click Sheet1 Tab and select "View Code")
    Please Login or Register  to view this content.
    Put the same for Sheet2 (obviously changing the appropriate addresses).
    Foxguy

    Remember to mark your questions [Solved] and rate the answer(s)
    Forum Rules are Here

  5. #5
    Registered User
    Join Date
    07-03-2010
    Location
    Charlotte USA
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: mirror data between cells in different worksheets

    Thanks Foxguy,

    This is really helpful. I have done as you suggested and it works great.

    Would it be possible to identify different cells and it do just the same.

    eg mirror cell A1, B2, D3, with cells E4,F5,G6,

    Thanks

  6. #6
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: mirror data between cells in different worksheets

    see next post
    Last edited by foxguy; 07-05-2010 at 02:49 PM.

  7. #7
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: mirror data between cells in different worksheets

    Here's how I would do it to do for the least amount of typing, when I wanted to add to it.
    I didn't test this, so back up before using it.
    I did put in a debugging test, just change the "If True Then" to "If False Then", when you have debugged it enough.

    Put this into Sheet1 & Sheet2 modules.
    Please Login or Register  to view this content.
    then put the following code into a Standard module
    Change the addresses (or add to them as needed) in the section between the '*************
    Please Login or Register  to view this content.
    Last edited by foxguy; 07-05-2010 at 04:08 PM.

  8. #8
    Registered User
    Join Date
    07-03-2010
    Location
    Charlotte USA
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: mirror data between cells in different worksheets

    Hi Foxguy,

    Thanks again for your support.

    I have done as you said but get an error when it executes saying sFrom "Variable is not defined".

    Any ideas most welcome

  9. #9
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: mirror data between cells in different worksheets

    Sorry, missed that. I added the sFrom lines just by editing the code in the Forum, so I didn't have the compiler to check and make sure I did this.
    Include these 2 lines at the top of "Cells_Mirrored"
    Please Login or Register  to view this content.
    Last edited by foxguy; 07-05-2010 at 04:07 PM.

  10. #10
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: mirror data between cells in different worksheets

    Foxguy, please post in the default font size. It was set that size so people could conveniently read it.

    Thanks.
    Entia non sunt multiplicanda sine necessitate

  11. #11
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: mirror data between cells in different worksheets

    Hi shg;
    I can't see the difference between the default size and size 1. Is my computer different than yours?
    I use size 1 because I have trouble reading "Preview Post" without it. Is there some way to change it back to default after I have finished previewing. My editing box doesn't show the [size][/size] tags.

    Edited:
    Never mind that last line. I changed my editing choices, so now I see the size tags, and I can remove them before submitting.
    Last edited by foxguy; 07-05-2010 at 04:11 PM.

  12. #12
    Registered User
    Join Date
    07-03-2010
    Location
    Charlotte USA
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: mirror data between cells in different worksheets

    Hi Foxguy,

    I have put in the additional lines and the code runs but it does not mirror. Am I doing something wrong. I have followed your instructions. When you say a standard module I have selected insert and then selected Module. Should I be doing something else?

    Thanks for all you help with this.

  13. #13
    Forum Expert
    Join Date
    03-31-2009
    Location
    Barstow, Ca
    MS-Off Ver
    Excel 2002 & 2007
    Posts
    2,164

    Re: mirror data between cells in different worksheets

    Quote Originally Posted by dumdum View Post
    I have put in the additional lines and the code runs but it does not mirror. Am I doing something wrong. I have followed your instructions. When you say a standard module I have selected insert and then selected Module. Should I be doing something else?
    Somehow the macro lost a line. Don't know what happened to it. I lost it somewhere between my VBE and the forum.

    Anyway, add this line in the place indicated (hopefully it's in red. My computer doesn't show the colors, so I can't be sure).
    Please Login or Register  to view this content.

  14. #14
    Registered User
    Join Date
    03-05-2012
    Location
    Canada, eh!
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: mirror data between cells in different worksheets

    Hi, I'm trying to get this code to work but seem to be doing something wrong. Hope someone can help. I have attached my sample spreadsheet with the code in it.

    I have different issues.

    1) Sometimes the code will run and will kick out to a message box which pops up 4 times in a row.

    Please Login or Register  to view this content.
    2) Sometimes the code will run to

    Please Login or Register  to view this content.
    3) Sometimes excel crashes completely when I make a change in one of the cells.

    Am I missing something simple here?

    Thanks
    Attached Files Attached Files

  15. #15
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,604

    Re: mirror data between cells in different worksheets

    Forum Rules
    Please read and adhere to these simple rules!

    #2. Don't post a question in the thread of another member -- start your own. If you feel it's particularly relevant, provide a link to the other thread.
    Ben Van Johnson

  16. #16
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: mirror data between cells in different worksheets

    Welcome to the Forum, Avbanovice, unfortunately:

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread. It makes sense to have a new thread for your question because a thread with numerous replies can be off putting & difficult to pick out relevant replies.
    Last edited by arlu1201; 05-04-2012 at 07:34 AM.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  17. #17
    Registered User
    Join Date
    09-01-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: mirror data between cells in different worksheets

    Can this macro be adapted so that cells are mirrored across 3+ sheets?

    Worksheet names: Team Forecast, AH, AT,IJ, LJ, TK, NR

    Cell containing picklist (on every sheet): C3:D3 (merged)

    Picklist values within range: ='SF MRF'!H5:Y5

    Cell C3:D3 on every sheet needs to update to show the value that has been changed on one of the other sheets.

  18. #18
    Registered User
    Join Date
    09-19-2016
    Location
    Beirut,Lebanon
    MS-Off Ver
    2010
    Posts
    1

    Re: mirror data between cells in different worksheets

    Dear Fox Guy

    is it possible to make a two way link when the cells change because of formulas?

    Thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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