Hi,
I have an excel attached which consist of two tabs. I would like to rename "Summary" into "Controller" and delete the "Data" sheet.
I hope someone there will show and help me to do this.
Thanks,
Kamen
Solved! Go to Solution.
Anyone please...
You can use 'Overwrite file(Remove)' option to replace the file as deleting a sheet is not possible.
Thanks for the response. While your ideas work, I forgot to include in the file the condition that it should retain or preserve its formatting. I have once again save a sample file with format.
Also, I notice a quotation on the tab name. Can we remove it? Can you state your formula here again, i noticed something in the formula which I cant get.
Hope to hear from you guys and from anyone who would like to share their ideas. I need to solve this case for the project.
Thanks
Kamen
Can you try clicking Preserve formatting on Overwrite in the output tool
Hi, @KamenRider
1- You didn't read my post carefully.
Replace([FileName], '`Summary$`', 'Controller')
2- If you want to retain all format of sheet, maybe you need use python tool to save the case, like below code:
import openpyxl
import os
# Defind file path
ABC = "D:\abc\Rename and Delete.xlsx"
# Open Excel File
workbook = openpyxl.load_workbook(ABC)
# delete Sheet
if "Data" in workbook.sheetnames:
workbook.remove(workbook["Data"])
# Rename Sheet
if "Summary" in workbook.sheetnames:
worksheet = workbook["Summary"]
worksheet.title = "Controller"
# Save File
workbook.save(ABC)
# Close File
workbook.close()
Hi @flying008
Thank you for writing the formula since I get confuse with the punctuation you use with "Summary". Having it copy - paste fix the problem.
In line to the python code, can you help me how I am going to enter it in Alteryx? I still building my knowledge with Alteryx and especially not a coder expert.
I do hope this will solve the problem. Looking forward for your response and assistance.
Thanks,
Kamen
Hi @Swathi @nagakavyasri @flying008
Have used the Python tool using the code provided. Having a hunch of using it which I hope I am doing it right. See below errors I've got. I hope you could help me debug the error since I have zero knowledge in using python.
Thanks
Kamen
User | Count |
---|---|
19 | |
14 | |
13 | |
9 | |
8 |