Add custom names
Refer to the following example code to add custom names and set formula to a range in a worksheet.