The macro recorder turns worksheet actions into VBA statements. It is useful for a repetitive task whose steps stay the same, and it gives you code to inspect before you write a procedure yourself. Open the Developer tab and select Record Macro.
Choose a name that starts with a letter and contains no spaces. Store the macro in This Workbook. Make the worksheet entries you want to repeat, then select Stop Recording. Open Visual Basic to read the statements and use Run Sub to replay them.
A recorded value is a fixed entry. A recorded formula recalculates from its cell references. A recorded formula keeps working when new data arrives. Inspect the recorded addresses as well: recording an entry in B5 doesn't mean the macro will automatically find the next empty row.