Sync Data Between Sheets

bobby786

Board Regular
Joined
Apr 24, 2014
Messages
87
Office Version
  1. 2016
Platform
  1. Windows
I want the Columns from different sheet in the attached worksheet to be synced reciprocally. E.g. Sheet1 (CENTRAL) cell C8 is "producer", there is a similar cell in Sheet4(QC) C8 "producer", I want them all to be updated as soon as i enter data in Sheet1(CENTRAL). So that when I enter something in C8 of Sheet1(CENTRAL), it also appears in cells C8 (QC) Likewise, if i enter something in cell C9 (CENTRAL) I want the content to appear in Sheet4((QC) C9 the other linked cells and so on.

The next step would be to extend this code to work with other columns in the sheet , too. E.g. "Invoice" , "QTY" "Product Name" across all sheets and so on

Thanks a lot in advance to anyone who tries to help me!

The file is located here:

 
Can just simply put under Sheet1 (CENTRAL) this line
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Sheets("QC").Range(Target.Address) = Target.Value2
End Sub

Any change in CENTRAL will be duplicated in Sheet("QC")
Wow , you are great mate , i will play with this around today , i think this will work for me .I will post request if needed.

Thanks for your time and effort.

Regards
 
Upvote 0

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Can just simply put under Sheet1 (CENTRAL) this line
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Sheets("QC").Range(Target.Address) = Target.Value2
End Sub

Any change in CENTRAL will be duplicated in Sheet("QC")

I am running into one issue , Columns in CENTRAL and QC sheets are not same after K , so if i fill something in COL L to COL XX , it will get duplicated in QC sheet as well .

For E.G
in CENTRAL COL P is "Silk Printing Date" where as in QC sheet COL P represent "QC Info Icon" i dont want Central to duplicates after COL K to be specific . Is it doable ?
 
Upvote 0
You can skip any column you like by adding more column letter other than K here
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim strCol As String

strCol = Split(Target.Address, "$")(1)   ' This extract column letter
Select Case strCol
    Case "K"
    
    Case Else
        Sheets("QC").Range(Target.Address) = Target.Value2
End Select

End Sub
 
Upvote 0
My bad... Did not read carefully. You said anything after column K. You do not want to list all column alphabets ?

Need to change to something else but not I need to go somewhere for a while.
 
Upvote 0
You can skip any column you like by adding more column letter other than K here
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim strCol As String

strCol = Split(Target.Address, "$")(1)   ' This extract column letter
Select Case strCol
    Case "K"
   
    Case Else
        Sheets("QC").Range(Target.Address) = Target.Value2
End Select

End Sub
I want to skip the COL from L to AZ in QC sheet.
i tried the below code with changes but it does not work , may be you can help me modify it .

VBA Code:
strCol = Split(Target.Address, "$")(1)   ' This extract column letter
Select Case strCol
    Case "L:AZ"
    
    Case Else
        Sheets("QC").Range(Target.Address) = Target.Value2
End Select

End Sub
 
Upvote 0
It is easier to use column number I think. Skip anything from L
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)

If Not Target.Column > 11 Then
    Sheets("QC").Range(Target.Address) = Target.Value2
End If

End Sub
 
Upvote 0
Solution
I want to skip the COL from L to AZ in QC sheet.
i tried the below code with changes but it does not work , may be you can help me modify it .

VBA Code:
strCol = Split(Target.Address, "$")(1)   ' This extract column letter
Select Case strCol
    Case "L:AZ"
   
    Case Else
        Sheets("QC").Range(Target.Address) = Target.Value2
End Select

End Sub
A range like that could not work since it is expecting a letter, not a range for strCol
 
Upvote 0
It is easier to use column number I think. Skip anything from L
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)

If Not Target.Column > 11 Then
    Sheets("QC").Range(Target.Address) = Target.Value2
End If

End Sub
Amazing ! it is working fine. I will play around with it.
 
Upvote 0
This will give exception to column L to AZ as I tried it
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)

Dim strCol As String

strCol = Split(Target.Address, "$")(1)
If Not strCol Like "[L-Z]" And Not strCol Like "A[A-Z]" Then
    Sheets("QC").Range(Target.Address) = Target.Value2
End If

End Sub
 
Upvote 0
This will give exception to column L to AZ as I tried it
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)

Dim strCol As String

strCol = Split(Target.Address, "$")(1)
If Not strCol Like "[L-Z]" And Not strCol Like "A[A-Z]" Then
    Sheets("QC").Range(Target.Address) = Target.Value2
End If

End Sub
Dear Zot ,

both of the solution is working , but i think i will go with number as its easy to remember .
 
Upvote 0

Forum statistics

Threads
1,223,950
Messages
6,175,582
Members
452,653
Latest member
craigje92

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top