Excel VBA Basic Training

Excel VBA Basic Training

Writing VBA

Before you start automating a process its key to first know how to perform the process manually.  You can’t really program Excel to perform a process that you don’t know how to perform manually.  A business process model can be useful as well. A business process model is a graphical representation of a business process that identifies key decisions in the process and what actions are performed.  Its kind of like a blueprint of the process for when  you’re building the macro.  Next you need to document all the steps the macro will take and convert any human decisions into defined logic.

For example a shipping list will route orders to different regional distribution centers depending on the recipients address.  In this case a human may filter for all addresses in the state of California and copy all those over to another sheet.  You would need to convert this decision over to defined logic such as.

IF Address State = California THEN move to CA Tab

There might be cases when you need to nest logic statements.  Like if address in California and City is Los Angeles then route to LA facility.

IF Address State = California THEN move to CA Tab

   IF Address City = Los Angeles THEN move to LA facility

Once you have all your procedure mapped out then you can start writing the macro.

[efb_likebox fanpage_url="https://www.facebook.com/vbamarket/" box_width="840" box_height=340"" responsive="1" show_faces="1" show_stream="1" hide_cover="1" small_header="0" hide_cta="0" locale="en_US"]

Add comment