I have the following situation: A file - fisierzero.xlsm that is on the Desktop, and two other files: one in the laminate folder named laminate.xlsm and one in the monolit folder named monolit.xlsm.
I guess I do not give the correct path in the VBA code because I have error 9 out of range error. all files are open.
Private Sub Worksheet_Change(ByVal Target As Range) Dim wb As Workbook Set wb = ThisWorkbook Dim keycells As Range Set keycells = Range("A:Z") Dim wb2 As Workbook Set wb2 = Workbooks("E:\monolit\monolit.xlsm") Dim wb3 As Workbook Set wb3 = Workbooks("E:\laminat\laminat.xlsm") Dim ws As Worksheet Set ws = wb2.Sheets("Sheet1") Dim ws2 As Worksheet Set ws2 = wb3.Sheets("Sheet1") If Not Intersect(keycells, Range(Target.Address)) Is Nothing Then ws.Range(Target.Address).Value = wb.Sheets("Sheet1").Range(Target.Address) ws2.Range(Target.Address).Value = wb.Sheets("Sheet1").Range(Target.Address) End If End Sub
Bookmarks