Solved: VBA that synchronize sheets to another sheet
Hi all, I found on the Internet a VBA code that will synchronize a certain range (A1:A10,B1:B10) from sheet 1 within sheet 4. The code (In ThisWorkbook) works fine so far.
Is it possible to change the VBA code that it on the same time also ranges (A1:A10,B1:B10) from sheet 2 and sheet 3 to be synchronized within sheet 4? Respectively for sheet 2 (A1:A10,B1:B10) synchronized within sheet 4 inrange ( A20:A30,B20:B30) and for sheet 3 synchronized within sheet 4 in range (A40:A50,B40:B50).
More info and the basic VBA code are put in the example Test.
Hi Marc
try it [vba]Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If Intersect(Target, Sh.Range("A1:A10,K1:K10")) Is Nothing Then Exit Sub
Dim i As Long
Select Case Sh.Name
Case "Sheet1": i = 1
Case "Sheet2": i = 21
Case "Sheet3": i = 40
Case Else: Exit Sub
End Select
With Application
.EnableEvents = False
Sh.Range("A1:A10,K1:K10").Copy Sheets("Sheet4").Cells(i, 1)
.EnableEvents = True
End With
End Sub[/vba]