Closed Thread
Results 1 to 13 of 13

Two Way Linking / Mirror Data between cells

  1. #1
    Registered User
    Join Date
    01-15-2016
    Location
    California
    MS-Off Ver
    10
    Posts
    6

    Two Way Linking / Mirror Data between cells

    This is my first time on here so I am hoping someone can help me.
    I am trying to do two way linking or mirror data with a twist. I’ve searched this and other forums but came up blank.
    I want to be able to edit two different cells on different sheets, so if I change one cell the other one will mirror it and vice a versa. Here is my situation.
    I keep track of company projects. Each project has its own sheet. I have a summary sheet that has specific information from each project sheet. For example, if I am on the Summary sheet and change the Contractor Name and the Start Date, the data will change on each project page. The kicker is, I will be adding sheets as I acquire more projects. Is it possible to have it automatically be set up so I don’t have to adjust the VBA or Macro?

    I’ve attached a sample copy of my file.
    Sample Two Way Linking.xlsx

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Two Way Linking / Mirror Data between cells

    Hi cfiore and welcome to ExcelForum,

    I am not sure what you want mirrored by looking at your file. What you want to do can be done using VBA if it is known exactly what you want, e.g. what sheets to include or exclude, what cells to include or exclude.

    See post #3 (includes a sample file) that solves a similar problem, except in that application, the mirroring is one one sheet.
    http://www.excelforum.com/excel-prog...ml#post4258328

    Lewis

  3. #3
    Registered User
    Join Date
    01-15-2016
    Location
    California
    MS-Off Ver
    10
    Posts
    6

    Re: Two Way Linking / Mirror Data between cells

    Thank you Lewis, I will take a look at that link.
    I know I am not very good at explaining things sometims.
    What I want mirrored is:
    The yellow cell on the Summary page for Alpha (Summary B5) should match the yellow cell in the Alpha sheet (Alpha B3), the yellow cell on the Summary page for Beta (Summary B6) should match the yellow cell in the Beta sheet (Beta B3).The Orange cell on the Summary page for Alpha (Summary C5) should match the yellow cell in the Alpha sheet (Alpha G1), the Orange cell on the Summary page for Beta (Summary C6) should match the Orange cell in the Beta sheet (Beta G1), and so on with each color.

    Then when I add another sheet, for example Delta sheet, the cells have to mirror in the same way.

  4. #4
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Two Way Linking / Mirror Data between cells

    Hi,

    Your description told me exactly what I needed to know. See the attached file which should get us started on what you want. The code was written using Excel 2003, so some of your Conditional Formatting is probably lost. We can take care of that later.

    Your design introduces a philosophical conundrum. If there is a difference between what is on the 'Summary Sheet' and the 'Other Sheets', which value is the (MASTER VALUE) correct value. If there is a difference I provided two macros:
    a. Update Summary Sheet From Other Sheets
    b. Update Other Sheets From Summary Sheet

    The software does not allow cut and paste of more than one cell. When big changes are needed, use the 'Disable Macros' macro to enable cut and paste of more than one cell. Make sure to 'Enable Macros' when your are done.


    I used the following rules to implement the software:
    a. Sheet Names must match names in Column A on the Summary Sheet.
    b. The First Two Words in Row 3 of the Summary Sheet must match the titles on the Data Sheets.
    c. All values on 'Alpha', 'Beta' etc. must be exactly one column to the Right of the 'Header Value'.
    d. All items to be processed musts be manually changed (not changed by formula).
    e. Only one Cell can be changed at a time.

    Notes:
    a. On Summary Sheet 'Date Start' changed to 'Start Date'.
    b. Double Click Cell 'A1' on any sheet to go to the Summary Sheet.
    c. On Summary Sheet 'L3' Commission was changed to 'Commission Paid'.

    How the Software works:
    a. Processing takes place each time a cell is manually changed.
    b. Summary Sheet change:
    (1) The 'Sheet Name' is obtained from Column 'A' of the Row changed.
    (2) The 'Category' is is obtained from Row 3 of the 'Column' Changed.
    (3) The 'Sheet Name' is searched for the 'Category'
    (4) The cell to the right of the 'Category ' is updated with the new value.
    c. Other Sheet change:
    (1) The 'Category' is obtained from the cell immediately to the left of the cell that changed.
    (2) 'Summary Sheet' Column 'A' is searched to obtain the row that contains the 'Sheet Name'.
    (3) 'Summary Sheet' Row 3' is searched to obtain the column that contains the 'Category'.
    (4) The 'Summary Sheet' is updated with the new value in the cell that contains the row and column found in steps 2 and 3.

    To enable Macros and to Run Macros see the following:
    http://office.microsoft.com/en-us/ex...010031071.aspx
    http://office.microsoft.com/en-us/ex...010014113.aspx
    If help is still needed do a google search for 'youtube excel enable macro' and/or 'youtube excel run macro'.

    To access Visual Basic (VBA) see:
    http://www.ablebits.com/office-addin...a-macro-excel/
    a. Click on any cell in the Excel Spreadsheet (may not be needed).
    b. ALT-F11 to get to VBA.
    c. CTRL-R to get project explorer (if it isn't already showing).
    d. Double Click on a 'Module Name' in 'Project Explorer' to see code for that module.

    Code is included in the following post.

    Lewis
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Two Way Linking / Mirror Data between cells

    Code from the file associated with the previous post:

    In the ThisWorkbook Code Module:
    Please Login or Register  to view this content.

    In ordinary code Module ModProcessChangeEvent:
    Please Login or Register  to view this content.
    Lewis

  6. #6
    Registered User
    Join Date
    01-15-2016
    Location
    California
    MS-Off Ver
    10
    Posts
    6

    Re: Two Way Linking / Mirror Data between cells

    Hi Lewis.
    This is GREAT!!!
    Forgive me but I am a novice when it comes to writing this kind of codes. I need to make some adjustment by I am not sure how. I’ve looked over this code to see if I can modify it myself and I am lost.
    Is it possible to have some of the cells on the Summary Sheet NOT mirror and have formulas? For example on the Summary Sheet to have Columns F (COR Issued), G (COR Approved), H (Total Contract) ,I (Expenses & Overhead), J (Gross Profit), M (Percent Commission), and M (Date Paid) to have formulas.
    I don’t mind change the order of the columns on the Summary Sheet if that helps

  7. #7
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Two Way Linking / Mirror Data between cells

    You can change the code, You just didn't know it.


    The following is an excerpt from the top of code module ModProcessChangeEvent. The Items in Red are the items that are mirrored (on the Other Sheets). Add or remove values as needed.
    Please Login or Register  to view this content.
    For example (hypothetically) to remove Cell B5, and to add cell H7, the line would become:
    Please Login or Register  to view this content.


    If this does not solve your problem, let me know and we'll figure something out.

    Lewis
    Last edited by LJMetzger; 01-19-2016 at 01:30 PM.

  8. #8
    Registered User
    Join Date
    01-15-2016
    Location
    California
    MS-Off Ver
    10
    Posts
    6

    Re: Two Way Linking / Mirror Data between cells

    Thank you but I think I am doing something wrong. I change the list of cell like you explained (i think it was like you explained)

    'Other Sheet Constants
    '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    Private Const sDataSheetCellstoPROCESS = "B3,B6,B13,E13,G1:G2"
    Private Const nDataSheetStartROW = 1
    Private Const nDataSheetEndROW = 13

    Cells B10 and B12 were still mirroring on the data sheets

    VBA Sample.jpg

    Can you see what I did wrong?

  9. #9
    Registered User
    Join Date
    01-15-2016
    Location
    California
    MS-Off Ver
    10
    Posts
    6

    Re: Two Way Linking / Mirror Data between cells

    Also, after I enter a value into one of the mirrored cells, it automatically transfers me to that page. For example: if I enter a value in Start Date on the summary sheet, when I exit the cell it transfers me to the data sheet. Is there a way to too turn that off?

  10. #10
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Two Way Linking / Mirror Data between cells

    Hi,

    I apologize for the problems. You didn't do anything wrong. I did not implement the sDataSheetCellstoPROCESS array correctly.

    I also commented out the two places that change the Sheet focus. I orginally implemented the code that way, so when you made a change that changed something on the other sheet, you would get positive feedback that the other sheet changed value, because the focus was now on the other sheet.

    Try replacing the existing ProcessChangeEvent() with the code below, changes in red:
    Please Login or Register  to view this content.
    Please let me know if you have any more questions and/or problems.

    Lewis

  11. #11
    Registered User
    Join Date
    01-15-2016
    Location
    California
    MS-Off Ver
    10
    Posts
    6

    Re: Two Way Linking / Mirror Data between cells

    That works perfect!!!
    Thank you so much.

  12. #12
    Registered User
    Join Date
    09-24-2020
    Location
    singapore
    MS-Off Ver
    15
    Posts
    2

    Re: Two Way Linking / Mirror Data between cells

    Hi Lewis

    I am also a novice with excel VBA. I also wish to do this mirror linking but I am not sure which or what to edit from your script. I attached my sample excel workbook for reference. Basically, my manager will do a monthly worksheet whereby he will input all information as per the sample. I, on the other part, need to compile all those information into the last worksheet "Admin Use" where I need to pass it to my Director as and when needed and he on the other hand prefers a long list of everything. So I have been copying and paste link all these while but there are times where I missed on the updated information keyed in on the monthly worksheets. If it is possible can include all formatting that are done on the worksheets like text wrap, background fill and change of font colour. I really appreciate for any help given. I am using Excel 2016. Thank you.
    Attached Files Attached Files

  13. #13
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,937

    Re: Two Way Linking / Mirror Data between cells

    Administrative Note:

    Welcome to the forum.

    We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

    Please see Forum Rule #4 about hijacking and start a new thread for your query.

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

Closed Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. mirror data between cells in different worksheets
    By dumdum in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 09-19-2016, 02:40 AM
  2. [SOLVED] Mirror Cells within the same column
    By breakchad in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-09-2014, 12:09 PM
  3. Mirror cells - two worksheets, random cells. Attempted code provided
    By ld2x07 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-18-2014, 09:30 AM
  4. [SOLVED] Mirror only visible cells
    By bpyoung83 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-01-2013, 04:43 PM
  5. How do I mirror data between cells in different workbooks?
    By d0nt_panic in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-10-2013, 04:57 PM
  6. Mirror Cells
    By darksupernova in forum Excel General
    Replies: 7
    Last Post: 03-03-2010, 12:16 PM
  7. Using "mirror image" of cells to delete duplicate data?
    By abcd1234 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-11-2007, 09:12 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