VBA Introduction

Spread the love

VBA is an object oriented language and supports at many platforms, it helps to automate tasks and writing a program  which can cover a long procedure. The basic concept and requirement at scripting level are same as other languages; a user can understand VBA easily if has worked on any language like java, c sharp, c++ etc. Or of course  can learn if does not have coding experiences.

New users can start learning VBA by recording macro option in excel which helps to record steps, but it should be  step by step. Generally, users make mistake to record a macro to take multiple steps which confuses a lot in the beginning.

We are going to share very smooth process which helps to new user to grasp it quickly.
How VBA works and what are the multiple methods to work on it.

  • Short automation, (Record a macro and do some amendments for quick analysis)
  • Control excel through Form control (for user input )
  • VBA form controls and designing for Projects  ( ActiveX Form control Designing)
  • VBA libraries to connect office Applications and Databases
  • VBA web handling (initially supports  Internet Explorer)
  • VBA with Selenium wrapper to control other web browser (chrome, Mozilla etc.)

 

VBA Modules

ModuleInitial code writing page and define sub , functions etc
ClassDefine Classes
User FormHelps to design user interface (UI) for end user ,
User Form ActiveX ComponentButton, ComboBox, CheckBox, Radio/Option Button, GroupBox ,Button , ComboBox, CheckBox, Radio/Option Button , GroupBox, Spin Button, Label, Text box and Shapes (assign macro)
Excel Form ComponentButton, ComboBox, CheckBox, Radio/Option Button, GroupBox ,Button , ComboBox, CheckBox, Radio/Option Button , GroupBox, Spin Button, Label, Text box and Shapes (assign macro)

 

Code writing for creating a procedure/event in module

Private Sub It is not visible in Macros list
SubExecutable by end users, user can view
Private Function It is not visible in function list
Libraries and References add to another application’s as reference Another language can be processed
Private Property
Public Property

 

Options to define data type, objects, variables, statement Etc. in codes

Data Type Integer, long, string, variant, Double Float, Date, Time Etc.
Variable define types Const,Dim,dim,Static
Conditional Statements If , Case
Use Object’s Property With {……} End with – uses object’s property
Define own Objects Public Enum {……..} End and Type {……} End Type – User defined property