Welcome to Excel VBA code

No matter how complicated a program is, it is made of many smaller and tiny fundamental working parts of programming code. Each of them accomplishes a specific task. Some may just consist of only one or a few lines of code. Knowing the functions of these fundamental working parts, you can then easily write an unlimited number of working programs. And knowing them, you can easily understand the programs written by others and adopt into your programs the ideas and the efficient code that are presented in those programs.

In this site, you will find many tiny working parts of VBA code in accomplishing many simple and yet meaningful tasks. To add a workbook, to auto-fill a range, to sort a table of data, to loop through and manipulate a folder of Excel files, to place a control on the Ribbon, and to send an email are some examples of these tiny working parts.

This is the site for you, if you are new to Excel VBA or if you are looking for ideas and samples of VBA code to accomplish certain tasks when you are in the process of writing a program. It focuses on VBA in Microsoft Excel for Windows.

The items in the Build a Foundation drop-down menu are for those who are new to Excel VBA, but should have a basic understanding of programming language, such as C or Python. The reader should be an average Excel user in order to follow the steps and test the VBA code.

The items in the Changing workbook appearance drop-down menu are for readers looking for ideas and samples of VBA code on how to change the appearances of a workbook. The main purpose of changing the appearance is to let the users to have a better working experience when they are using your program.

The items in the Working with ranges drop-down menu are for readers looking for ideas and samples of VBA code on how to refer to ranges and work with ranges. Once you get a range referred, you can perform various operations on the range. Finding the last nonempty cell, auto-filling the range, converting formulas to values, conditionally formatting the range, sorting the range, and exporting the range out of Excel are some of the operations.

The items in the Working with sheets, workbooks, and files drop-down menu focuses on commonly used operations on sheets, workbooks, and files.  Copying a sheet, protecting a sheet, creating a table of contents for all sheets with hyperlinks, saving a copy of a workbook, self-deleting a workbook, protecting a workbook, accessing a password-forgotten VBA project, prompting users to select a folder, a file, and multiple files, writing and reading a text file, looping through a folder of files, and creating and deleting folders are some of the operations.

I hope this site will serve as quick references in facilitating you to write an unlimited number of working VBA programs. Let Excel VBA work for you.

 

References

The webpages accessed via the menus are based on the books published by the author of this site. The author will add an additional menu when an additional book is published or ready to be published.

The items in the Build a Foundation menu are from a book entitled Learn Excel® VBA in 24 Hours – A quick reference for beginners.

The items in the Changing workbook appearance menu are from a book entitled Dissect and Learn Excel® VBA in 24 Hours – Changing workbook appearance.

The items in the Working with ranges menu are from a book entitled Dissect and Learn Excel® VBA in 24 Hours – Working with ranges.

The items in the Working with sheets, workbooks, and files  menu are from a book entitled Dissect and Learn Excel® VBA in 24 Hours – Working with sheets, workbooks, and files.

 

Supplementary files

You can download the supplementary files for the books. The files definitely facilitate you to master the contents of the books.

 

Warning and Disclaimer

Every effort has been made to make the content in this site as accurate as possible. However, no warranty or fitness is implied. The author shall have neither responsibility nor liability to any person or entity with respect to any losses or damages arising from the information contained in this site.