In VBAProject you will see a list of Microsoft Excel Objects e.g. Sheet1 (Sheet 1). The text inside the bracket is the worksheet name i.e. what you have called it. So as long as you see:
Sheet1 (PLANNED) and Sheet2 (FINAL) you will not have to change Sheet1 and Sheet2 in the VBA code.
Otherwise replace Sheet1 with Sheets("PLANNED") and Sheet2 with Sheets("FINAL"),
e.g.:
For r = 4 To Sheets("PLANNED").UsedRange.Rows.Count
If Sheets("PLANNED").Range("C" & r) = Sheets("FINAL").Range("B3") Then
Sheets("FINAL").Range("C" & i) = Sheets("PLANNED").Range("B" & r)
Sheets("FINAL").Range("D" & i) = Sheets("PLANNED").Cells(r, matchMonth)
i = i + 1
End If
Next r
For example Cell A3 B 3 is now A5 B5. As long as I keep my cells and rows aligned in the code, the logic is the same.
Given A3 is now A5 and B3 is now B5 (you haven't specified if the layout has changed in any other way), but for these changes, for example:
If Target.Address = "$A$5" Or Target.Address = "$B$5" Then
and
matchMonth = Application.Match(Sheets("FINAL").Range("A5"), Sheets("PLANNED").Range("3:3"), False)
and
If Sheets("PLANNED").Range("C" & r) = Sheets("FINAL").Range("B5") Then
Bookmarks