简体   繁体   中英

What is the easiest way to automate Excel tasks

If I need to automate a series a task on an excel sheet like

  • remove all rows where column 3 contains value "asdf"

  • remove column 7 and column 9

  • sort according to column 4

etc.

What is the easiest way of automating such tasks in excel? I think it would recording a macro but sometimes macro have to be edited a lot to actually make them work and even then macros stop if the excel sheet has a variation. Editing macro scripts could be a time taking process which becomes inefficient for such tasks. The automation is required since number of excel sheets will be a lot. Can you suggest an easier way ?

As long as, you have the activities defined - Macro is still the better thing to look for.
There could be some things that could change.

Please explain the problem with the help of code.
If you have defined the steps with a few variables, it should be easy to write a macro that wouldn't stop in case of variation.

Please post the code and describe in detail what you would want? which point does it stop, in case of variation? What would you like the code to do?

EDIT: Alternatively, you can write code in VB6/.net (c#/vb.net)/Python for automation.

If you record these steps using the macro recorder it will work fine, these are the ideal types of things for the macro recorder as the parameters (ie your sort by and delete conditions) are always the same. Just make sure that you always import/paste the data to the same place! Thanks Ross

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM