Hi @Suraj_Adhikari I hope you are doing well.
You can use the Action “Run VBScript” and run a Visual Basic Script as shown here below:
' Create an instance of Excel application
Set objExcel = GetObject(, "Excel.Application")
' Get the workbook named "Book1.xlsx"
Set objWorkbook = objExcel.Workbooks("Book1.xlsx")
' Get the worksheet named "Sheet1"
Set objWorksheet = objWorkbook.Worksheets("Sheet1")
' Create N copies of the worksheet
For i = 1 To %UserInput%
objWorksheet.Copy , objWorksheet
Next
' Clean up the objects
Set objWorksheet = Nothing
Set objWorkbook = Nothing
Set objExcel = Nothing
The variable name %UserInput% is created in action #2. The Input Dialog Action can be use in this way to define how many copies do you need, see image below.
In this example I’m testing with an Excel File named Book1 and a tab named Sheet1, if the file name and tab name will change, you can adjust accordingly and use Variables instead.
Hope this helps,
If I have addressed your inquiry successfully, kindly consider marking my response as the preferred solution. If you found my assistance helpful, a 'Thumbs Up' would be greatly appreciated.
Additionally, if you have any questions, feel free to DM me, and we can initiate a discussion.
Kind regards,
Will SG
Managing Director & Automation Lead
RAMS CR (Recruitment & Automation)
LinkedIn Profile
