I have a sheet with the pricing of different products. These prices are updated very frequently, and I would love to find a solution whereby, whenever I change the date on cell B2, the date and pricing of the products are automatically recorded in a column in a different tab, called Archive.
Pricing Tab

(source: imggmi.com)
Archive File

(source: imggmi.com)
I have found several scripts that automatically record values in a different sheet based on specific values such as 'Done' or 'Completed' but I'm not sure how to adapt those scripts when the target value is always changing (i.e. cell B2).
One of those scripts are:
function onEdit() {
var sheetNameToWatch = "Pricing";
var columnNumberToWatch = 2;
var valueToWatch = "[Unclear what the value should be]";
var sheetNameToMoveTheRowTo = "Archive";
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = SpreadsheetApp.getActiveSheet();
var range = sheet.getActiveCell();
if (sheet.getName() == sheetNameToWatch && range.getColumn() == columnNumberToWatch && range.getValue() == valueToWatch) {
var targetSheet = ss.getSheetByName(sheetNameToMoveTheRowTo);
var targetRange = targetSheet.getRange(targetSheet.getLastRow() + 1, 1);
sheet.getRange(range.getRow(), 1, 1, sheet.getLastColumn()).moveTo(targetRange);
sheet.deleteRow(range.getRow());
}
}
The full sheet can be found here: https://docs.google.com/spreadsheets/d/13UAx8ANRkvLcLZ7Pxj4INigQatFpv8F2NF6AVuRSPb8/edit?usp=sharing
The ideal output would be a script that can automatically record pricing values based on cell B2. If there's a simpler solution to this, it is very much welcome! Thanks in advance.