I'm sorry, I thought it works for all the sheets.
All (J2) of sheets are linked to J2 of sheet1. I want to rename the sheets based on the value of their corresponding (J2). When I tried to put all your codes and change the value of (J2) in sheet1 only the name of sheet1 changed and others didn't changed but the value of their (J2) already changed.