Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =HYPERLINK('C:Reports2018[2018.xlsx]Sheet1'!U21)
- Dim wkbYear
- Private Sub Worksheet_Change(ByVal Target As Range)
- If Target.Address = "$E$1" Then
- ' here i replace the formula 2018 -> 2019
- ' file 1
- Sheets("Sheet2").Range("B6").Formula = Replace(Sheets("Sheet2").Range("B6").Formula, wkbYear, Target)
- ' file 2
- Sheets("Sheet2").Range("D6").Formula = Replace(Sheets("Sheet2").Range("D6").Formula, wkbYear, Target)
- ' I excluded the 20 other similar lines of code here.
- End If
- End Sub
- Private Sub Worksheet_SelectionChange(ByVal Target As Range)
- If Target.Address = "$E$1" Then
- wkbYear = Range("E1").Value ' Old year value
- End If
- End Sub
Add Comment
Please, Sign In to add comment