Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Option Explicit
- Private Sub Worksheet_Change(ByVal Target As Range)
- Dim rng As Range
- Set rng = Range("A1")
- If Not Application.Intersect(rng, Range(Target.Address)) Is Nothing Then
- Call updateCells
- End If
- End Sub
- Function updateCells()
- Dim wb As Workbook
- Dim wsFirst As Worksheet
- Dim wsSecond As Worksheet
- Set wb = ThisWorkbook
- Set wsFirst = wb.Worksheets("Sheet1")
- Set wsSecond = wb.Worksheets("Sheet2")
- wsSecond.Rows(1).Insert shift:=xlShiftDown
- wsSecond.Cells(1, 1) = wsFirst.Cells(1, 1).Value
- End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement