i have a sheet that have 5 columns (date , id , name , number ,row number) and i want the fifth column(row number) to be auto filled with the row number when i insert any data in the second column(id) i tried the manual way from the sheet itself not apps script but sometimes it gets deleted by mistake so i want to do it with apps script and im not sure if there is a way or not so please help me with it. here is what i mean in example:
first row got headers (date, id , name , number , row number) lets say i insert in the fifth row some data (today , 4 , ahmed , 4584231 , X)
I WANT WHEN I INSERT THE ID(4), THE ROW NUMBER GETS VALUE (5) AUTOMATICALLY BECAUSE ITS IN THE FIFTH ROW, THEN AFTER THAT LETS SAY I REMOVED ROW NUMBER 3 I WANT ALL THE VALUES IN THE ROW NUMBER COLUMN TO BE CHANGED TO THE NEW ROW IT GOT IN, I HOPE THAT WAS CLEAR FOR YOU.
thank you very mush