The code expects the "Data" sheet to always be the active sheet, when you switch to "Bet Angel", it can't find what it's looking for on that sheet, so, as you found, it throws an error.
To re-set it without closing it down, make sure that the "Data" sheet is the one in view, then just below the "run" button on the top row, there's a little blue box (re-set), press this.
Try the code below (untested), it does the same thing as what you've already got but doesn't need to select anything, hence there shouldn't be a problem when switching between sheets.
Code: Select all
' Record_data macro
Dim rngFrom As Variant, rngTo As Variant
Set rngFrom = Sheets("Data").Rows("5:5")
Set rngTo = Sheets("Data").Rows("7:7")
rngTo.Value = rngFrom.Value