• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to build the Logic to write VBA Codes ?

This question has been haunting me since I started learning excel and VBA. All of us know the jargons and syntax in VBA. We know a bit of simple VBA codes to use input boxes, message box etc. But when it comes to building complex VBA codes, I become blank. I dont know where to start. Unfortunately, most of the excel gurus I met could not provide me a precise answer as to how to go about the logic behind a problem before we start writing VBA codes. Can anyone please answer this question ? Please help me understand and also what do I need to practice in order to master this ?
 
Hi Vinyas

VBA is a relatively simple language, particularly if the person learning it is already an excel user. On the most part all VBA is doing is automating a repetitive task to save the user some time.

A complex procedure as you put it is just a lot of smaller procedures joined together, or it is for me. I just break a procedure down into small chunks.

There are courses you can do but the best way in my opinion to learn VBA is to read forums like this one every day. When you feel confident try and solve a problem or two. Then compare your answer with the answers on the post. Most posts on this forum are by quite proficient posters and if you follow their lead continually your coding will become more like theirs. It takes time but if you persist you will become very proficient very quickly. Like most things in life it all comes down to how much effort you are prepared to put into it.

When you do get proficient read this. It is a set of rules helps focus your coding so it becomes tight but readable.

The Golden Rules

Happy coding

Smallman
 
Last edited:
Hi Sreedhar ,

If you are already good at writing simple code , then you are doing something unconsciously ( without realizing it ) ; if you have to write complex code , you need to do the same thing , but consciously , and on a larger scale.

What you are talking about is algorithms ; designing algorithms is not only complex but also creative ; for any problem , there may be more than one way of solving it.

In computer programming , as in any other skill / art , you need to learn the building blocks , before you can think of applying them to solving more complex / complicated problems.

See these two links for further information :

http://www.topcoder.com/tc?d1=tutorials&d2=alg_index&module=Static

https://www8.cs.umu.se/kurser/TDBA77/VT06/algorithms/BOOK/BOOK3/NODE124.HTM

Narayan
 
Back
Top