Hello All, a small help needed
I want to rename a sheet with the data which is there in that sheet A1.
For example- in a excel file Input.xlsx, in sheet1 the string data in A1 is “Profit”
My bot should rename the sheet name from sheet1 to Profit… How to do it?
Create a new project and add an Excel Application Scope activity.
In the Excel Application Scope activity, provide the path to the Excel file that you want to rename the sheet in.
Add a Rename Sheet activity inside the Excel Application Scope activity.
In the Rename Sheet activity, set the following properties:
NewSheetName: The new name of the sheet. This will be the data that is in A1 of the sheet.
OriginalSheetName:The name of the sheet that you want to rename. In this case, it will be “Sheet1”.
Workbook:The DriveItem of the workbook whose sheet is renamed. This can be obtained from the output property of the Find Files And Folders activity.
Step 1 => Take Use excel file activity and give the path of the excel file
Step 2 => Inside use Excel file activity insert the read cell activity to read the cell A1 in range give like below.
Excel.Sheet(“Sheet1”).Cell(“A1”)
Store the output in a string variable.
Step 3 => after read cell insert the rename sheet activity.
Give the range Excel.Sheet(“Sheet1”) in from field.
Pass the String variable in to field in rename sheet activity.
@Yoichi @vrdabberu
Thanks for the solution.
Both the solution are easier to understand and fulfills my requirement,
but marking only one as solution for thread closure.