How to add a column with a formula in Excel

how to add a column with a formula in Excel in the range K1: K999

Hi @RPA3,

for that you can simply record a macro in excel, store macro VBA code in a txt file and use Invoke VBA activity to invoke that VBA code in Uipath.
Run the sequence and it’ll add the column as specified in macro.

Is it possible for a macro to add a range such that how many rows are filled in other columns and only fills?