codeliftsleep
Board Regular
- Joined
- Apr 14, 2017
- Messages
- 103
Hey all,
I'd just thought I'd chime in with my opinion after reading and attempting to help some posters over the last few days. I've been on the board here and there in the past asking questions on things I havent been able to find on Google related to VBA mainly.
My opinion, from what I've seen is that many of the solutions are poorly implemented. Columns with the same names, cells containing numerous values separated by commas, but most of all just things that dont make logical sense from a programmatic and design standpoint.
I use Excel a lot at work due to working for a bank. Banks love Excel, but they love it a little too much. They try and use it for everything. I am a programmer by trade that was brought in to properly design and automate various reports and to build standalone systems/applications that could be used to streamline various parts of the business.
Proper design is EVERYTHING when building solutions. In my opinion, a big part of the issue is that Microsoft allows people to record macros which are terribly inefficient and trains people to program poorly or not learn at all and simply rely on macros they record. Let me give an example. When I first started working at my job, one of the first projects was to automate a daily report that was taking 3 to 4 hours to do manually. There was a huge section of code that did a lot of copying and pasting and math between sheets and cells. This part of the code took 30-40 minutes to run. When I looked ar why it was slow, I saw about 700 lines of code which obviously was a macro that was recorded and not changes at all.
After completely re-writing this section from scratch I cut the code in half and it finished in under a minute. In fact the entire report now runs in under 15 minutes a day now and that is with 2 new sections added that werent there originally.
I say this not to brag but to show how terrible the recorded macros are if you are using them as is-which from many of the code samples I see on here, is the case.
My first piece of advice would be if you see this, run as fast as possible away from this solution. My second piece of advice is to stop using this as a crutch and take time and learn how to program VBA properly. VBA is a very easy language to learn, by far the easiest of the languages I use regularly(C#, VB.net, C++, PHP, VBA and javascript).
You may say this is going to take too much time that you dont have. Well, i would counter by saying that the amount of time you spend waiting on your code to run using macros that have been recorded will give you plenty of time to learn the proper way and start using it. You will end up spending time one way or the other...better you take that time and learn how to use it to save a lot of time in the future.
Either way, I'd advise the mods to create a proper design thread so people can post what they are trying to do and people can help them to actually design things to create a solid foundation to build off of rather than building a house of cards that you realize will not work properly after you've built it to a certain point.
I'd just thought I'd chime in with my opinion after reading and attempting to help some posters over the last few days. I've been on the board here and there in the past asking questions on things I havent been able to find on Google related to VBA mainly.
My opinion, from what I've seen is that many of the solutions are poorly implemented. Columns with the same names, cells containing numerous values separated by commas, but most of all just things that dont make logical sense from a programmatic and design standpoint.
I use Excel a lot at work due to working for a bank. Banks love Excel, but they love it a little too much. They try and use it for everything. I am a programmer by trade that was brought in to properly design and automate various reports and to build standalone systems/applications that could be used to streamline various parts of the business.
Proper design is EVERYTHING when building solutions. In my opinion, a big part of the issue is that Microsoft allows people to record macros which are terribly inefficient and trains people to program poorly or not learn at all and simply rely on macros they record. Let me give an example. When I first started working at my job, one of the first projects was to automate a daily report that was taking 3 to 4 hours to do manually. There was a huge section of code that did a lot of copying and pasting and math between sheets and cells. This part of the code took 30-40 minutes to run. When I looked ar why it was slow, I saw about 700 lines of code which obviously was a macro that was recorded and not changes at all.
After completely re-writing this section from scratch I cut the code in half and it finished in under a minute. In fact the entire report now runs in under 15 minutes a day now and that is with 2 new sections added that werent there originally.
I say this not to brag but to show how terrible the recorded macros are if you are using them as is-which from many of the code samples I see on here, is the case.
My first piece of advice would be if you see this, run as fast as possible away from this solution. My second piece of advice is to stop using this as a crutch and take time and learn how to program VBA properly. VBA is a very easy language to learn, by far the easiest of the languages I use regularly(C#, VB.net, C++, PHP, VBA and javascript).
You may say this is going to take too much time that you dont have. Well, i would counter by saying that the amount of time you spend waiting on your code to run using macros that have been recorded will give you plenty of time to learn the proper way and start using it. You will end up spending time one way or the other...better you take that time and learn how to use it to save a lot of time in the future.
Either way, I'd advise the mods to create a proper design thread so people can post what they are trying to do and people can help them to actually design things to create a solid foundation to build off of rather than building a house of cards that you realize will not work properly after you've built it to a certain point.