Mirroring columns to two different sheets

Status
Not open for further replies.

gomgom2

New Member
Joined
Jan 12, 2018
Messages
7
Hi guys.. my very first post to this site

What I am trying to do here is making a two way input range in two different sheets

That is, if I put anything in "A:A" Column(or specific range) in sheet1, it will appear on sheet2 "C:C" column(or specific range). Also, if I revise it on Sheet2 range, the changes will be automatically applied to the range in sheet1.

Hopefully I am making sense here.

I have tired to learn it on my own.. but stuck


For Sheet1
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    Dim r1 As Range, r2 As Range
    Set r1 = Sheet1.Range("Range1")
    Set r2 = Sheet2.Range("Range2")
    If Intersect(Target, r1) Is Nothing Then Exit Sub
        
    '    Range.(Target.Address).Value
    
        r2.Value = r1.Value
    
End Sub
For Sheet2
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    Dim r1 As Range, r2 As Range
    Dim c As Range
    Set r1 = Sheet2.Range("Range2")
    Set r2 = Sheet1.Range("Range1")


    If Intersect(Target, r1) Is Nothing Then Exit Sub
        If r2.Value <> r1.Cells.Value Then
        r2.Value = r1.Value
    End If
End Sub
Thank you in advance for everything.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
32,151
Office Version
365
Platform
Windows
Duplicate https://www.mrexcel.com/forum/excel-questions/1038659-vba-experts-needed-mirroring-columns-two-different-sheets.html#post4985539

Please do not post the same question multiple times. All clarifications, follow-ups, and bumps should be posted back to the original thread. Per forum rules, posts of a duplicate nature will be locked or deleted (rule 12 here: Forum Rules).

Note that sometimes posts from new users require Moderator approval before you can see them on the public forums. When this happens, you should see a message to that effect when you try to post it. Please be patient and do not attempt to post the question again.
 
Status
Not open for further replies.

Forum statistics

Threads
1,081,841
Messages
5,361,635
Members
400,642
Latest member
tekster23

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top