The strange status quo of programmers and VBA

Source: Internet
Author: User
Tags constant definition

Recently, I have been paying more attention to VBA in Excel. On the one hand, it is because the company has used VBA to do some work, which is not only efficient, but also very responsive to business personnel; in addition, I began to pay attention to the content on the excelhome website. I also downloaded some EXCEL gadgets that everyone liked to study.

In the process of doing these two things, I found thatProgramThere are two strange phenomena between personnel and VBA.

First, many people think that the VBA program is not a real program.

What should a program look like in most people's minds? Either the application, or the winfom form, or the website form. That is to say, either c/s or B/S, and which of the following statements should be used for VBA programs in Excel? It seems that none of them are counted, so we can conclude that such a program is not a program.

When I finished my work, I did not think of this problem. However, after the work was done, the department director told me that this was the first option for the business department, when you have time, you can try again.

In fact, I think it doesn't matter whether it is a so-called program. What's important is whether it meets the business needs and has many advantages that the so-called real program cannot achieve.

The lucky draw tool I developed fully meets the business needs, and the recent Lucky Draw was completed using that small tool. It not only completes the required functions, but also eliminates the need for business personnel to import and export Excel Data, in addition, the generated data can be easily filtered and sorted by Excel features. In addition, for business personnel, the learning curve is extremely low. I just explained it for about five minutes, and business personnel can perform independent operations completely. In this case, do you really need to develop something in the winform form to be a program?

Some people may prefer to write winform or web-based programs. On the one hand, they are familiar with programming in such an environment, but not very familiar with the VBA environment, I think it will reduce the efficiency of my work. On the other hand, I think that excel can be operated by many people who are not programmers. It is an office software, it cannot show your own advantages, haha.

Secondly, after reading many VBA programs, I found that there are many problems in the program that need to be improved.

It is very important thatCodeIn many well-known Excel tools, there are also serious code standardization problems. For example, various naming: the naming of variables is not bad. For various controls, many people use the original default names, such as commandbutton1 and sheet1. For example, the row and column operations, there are a lot of "magic numbers". For example, for column "B" operations, "B" is used. In fact, for such a thing, constant definition is used, it can be easily developed to a large extent, and also improve the maintainability of the program.

This problem may be caused by the fact that VBA is rarely used as the development language in large-scale development, and code standards are mostly used in large-scale project development. Therefore, many VBA developers did not notice these issues because no one asked for them.

The above two strange situations are a vicious circle. As there are many problems in the VBA program, programmers who have worked on large projects will sneer at the VBA developers who only write a large number of problems, they do not deserve to be real programmers, so they will not use VBA as development tools in actual work. Many people think that VBA developers are not real programmers. Developing VBA programs does not mean they have extraordinary technical strength, so that more people will not use VBA as the development tool when selecting.

I have two suggestions for the above situation: first, we need to recognize the advantages of VBA. in some specific cases, it can greatly improve the efficiency of developers and business personnel; as a VBA developer, you should pay attention to cultivating your own quality in the code development process, such as code specifications, or dry principles.

You are welcome to discuss this!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.