Calc Macro that replaces a cell value, if a search string is found in another cell

Hi everyone,

If a string “xyz” is found in a cell in F column, I would like to set a macro that would search the entire document, replacing the cell in G column in the same row, with a value from a cell underneath it.

Any help would be appreciated…

Example given:
F1 Cell: xyz, G1 Cell: 123
F2 Cell: anything, G2 Cell: 456

The result:
F1 Cell: xyz, F2 Cell: 456
F2 and G2 remain the same

Thanks and have a great day!

Do you mean “G1 Cell: 456” (not F2, but G1)? In other worsd - G1=G2=456?