cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

Delete a particular column 'A' or duplicate the excel without that column 'A' using Power Automate

Hello, Is there a way to delete a particular column - for instance column 'A'  in an excel using Automate? Or is it possible to duplicate the excel without that particular column? I currently run VBA script manually everyday to remove that particular column, but would like to automate it. Is this possible using Power Automate? 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Microsoft
Microsoft

Re: Delete a particular column 'A' or duplicate the excel without that column 'A' using Power Automate

Hi @rc38602 

 

This is possible using Office Scripts. Specifically, using Office Scripts with Power Automate. With Office Scripts you can schedule a script (in JS, not VBA) to run everyday. You just need to write a script using Office Scripts to delete the column. Here's a quick script I created to do this.

 

 

function main(workbook: ExcelScript.Workbook) {
  // Replace 'test' with the name of your worksheet.
  // Alternative use a different api to get the worksheet if it's not always absolute.
  let selectedSheet = workbook.getWorksheet('test');
  // Delete range A:A
  selectedSheet.getRange("A:A")
    .delete(ExcelScript.DeleteShiftDirection.left);
}

 

Best Regards,
Geoff
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

3 REPLIES 3
Highlighted
Community Support
Community Support

Re: Delete a particular column 'A' or duplicate the excel without that column 'A' using Power Automate

Hi @rc38602,

 

It's unfortunate that delete column is not supported in Power Automate yet, if you like this feature and want it could be added, you could head to this idea to vote it:

https://powerusers.microsoft.com/t5/Power-Automate-Ideas/Excel-Delete-a-column/idi-p/451511

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Highlighted
Microsoft
Microsoft

Re: Delete a particular column 'A' or duplicate the excel without that column 'A' using Power Automate

Hi @rc38602 

 

This is possible using Office Scripts. Specifically, using Office Scripts with Power Automate. With Office Scripts you can schedule a script (in JS, not VBA) to run everyday. You just need to write a script using Office Scripts to delete the column. Here's a quick script I created to do this.

 

 

function main(workbook: ExcelScript.Workbook) {
  // Replace 'test' with the name of your worksheet.
  // Alternative use a different api to get the worksheet if it's not always absolute.
  let selectedSheet = workbook.getWorksheet('test');
  // Delete range A:A
  selectedSheet.getRange("A:A")
    .delete(ExcelScript.DeleteShiftDirection.left);
}

 

Best Regards,
Geoff
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

Highlighted
New Member

Re: Delete a particular column 'A' or duplicate the excel without that column 'A' using Power Automate

Thank you! This is new, I have not used this before. My organisation does not have this enabled for now. Glad to see there are options.

Helpful resources

Announcements
FirstImage

Microsoft Ignite 2020

Check out the announcement of Power Platform content at Microsoft Ignite!

thirdImage

Experience what's new for Power Automate

Join us for an in-depth look at the new Power Automate features and capabilities at the free Microsoft Business Applications Launch Event.

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,891)