GithubHelp home page GithubHelp logo

vba_utility's Introduction

vba_utility

Some VBA utility functions / subs for Excel and Access.

Setting up Visual Basic for Applications (VBA)

VBA is a fairly old application and not up to date with modern IDE standards. There are some ways to adapt VBA by changing some setting or even adding add-ins.

Formatting & Tools

The following formatting and tools were suggested from GollyJer's Stackoverflow post

1 Deactivate Auto Syntax Check

Each time you jump to a new line with syntax errors in you existing line of code, you will get a pop-up. To deactivte the pop-up (errors will still get highlighted) in the Visual Basics Editor do the following:

Tools -> Options -> Editor Tab -> deselect Auto Syntax Check

2 Change Font

For a more readable / modern Font that is included in the standard Windows Font in the Visual Basics Editor do the following:

Tools -> Options -> Format Tab -> change the Font to Consolas (Western) and the size to 11

3 Make Edit Toolbar accessible

For easier commenting / uncommenting of code to make the Edit toolbar accessible in the taskbar in Visual Basics Editor do the following: Right Click the toolbar / menu -> Select the Edit toolbar, so it will appear as an additional toolbar which can be drag & dropped at convenience

4 Add-ins - Ruberduck

Ruberduck is an add-in that adds a wide set of feature to VBA (such as auto-indenting). According to their webpage they:

Bring the VBE into this century Or help us do it! Rubberduck is a very active open-source COM add-in project that integrates with the Visual Basic Editor to enable the features every programmer wants to have in their IDE. From unit testing to code inspections and refactorings, programming in VBA will never be the same.

Download and install the rubberduck extension

Website: http://rubberduckvba.com/

Github: https://github.com/rubberduck-vba/Rubberduck/releases

Coding Style Guideline applied in this project

Paul Kelly from excelmacromastery.com gives a great overview on variable types and their initilization.

Types and their declaration

Variable Type Abbbreviation Example Description
String str Dim str_name as String Basic
Long lng Dim lng_counter as Long Basic
Double dbl Dim dbl_variance as Double Basic
Currency ccy Dim ccy_cost as Currency Basic
Boolean bln Dim bln_status as Boolean Basic
Variant var Dim var_list as Variant Variant / Array

There is no reason to use Integer over Long due to it's limitations, as described by RubberDuck on Stackoverflow.

vba_utility's People

Contributors

sebinum avatar

Stargazers

Eric9400 avatar Brandon avatar

Forkers

eric54205420

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.