
Open the Visual Basic editor from Excel and save as macro-enabled workbook, exploring the menu, project list, properties, and code windows. Learn how VBA projects organize code within workbook objects.
Explore macro security in excel's trust center, detailing the four macro settings, how to enable or disable macros with or without notification, and why these controls matter when using vba.
Explore how a worksheet fits into the Excel object model, access properties like name, and count worksheets within the active workbook, using the Application, Workbook, and Worksheet objects.
Learn about the module on demand in VBA, a reusable component that holds variables, constants, functions, and subroutines, and can be exported or imported for use across workbooks.
Explore how public and private subroutines and functions control visibility across modules in VBA, enabling safe reuse of code, avoiding name conflicts, and protecting library code.
Explore common VBA variable types such as integer, long, single, double, boolean, and string, and how option explicit versus option implicit requires declaring every variable in Excel VBA.
Prepare a calendar-based excel table by creating and formatting a data column and generating months. Convert the range to a filterable table for database use.
Master how to use VBA to select parts of an Excel table, including the header, by defining an object, creating a function, and running a macro to select the header.
Learn to automate Excel table style options with VBA, toggling row and column banding, total row, first and last column, and filters via macros and recorded ribbon actions.
Resize an Excel table with VBA by selecting the table three, setting its range in the Visual Basic Editor, and adjusting rows and columns to the desired size.
Learn how to resize an Excel table by rows and columns using VBA, adjusting table size with row and column counts, and applying new dimensions to the existing table.
Learn to retrieve all tables from an Excel workbook with VBA by looping through each worksheet, checking for tables, and printing a consolidated list of table names.
Explore how to insert a sum into an Excel table by using the totals row, view totals with a list object, and automate with Visual Basic macros.
Define a dictionary as a native VBA object, create and reference it, add, change, and remove keys, retrieve values by key, loop through entries, and support case-sensitive searches.
Learn how to add items to a VBA dictionary, where keys can be any value and items include arrays or nested dictionaries; handle duplicates and multi-value keys.
Learn to assign a value to a key in a VBA dictionary, adding new keys when absent and updating existing keys such as John.
Learn how to remove items from a vba dictionary, including checking existence, removing specific keys, handling non-existent keys, and optionally removing all items to reset the dictionary.
Create a VBA function to build a ranking table using a dictionary of teams and arrays for score, goals for, and goals against, printed to the sheet.
Learn to create a collection as a collection object, instantiate its class, and manage memory by creating or destroying the collection/connection.
Learn two ways to remove all items from a VBA collection: clear the items while preserving the collection, or set the collection to nothing to destroy it.
Use for each loops to access all items in a collection, and compare with other loops to achieve cleaner and faster traversal of workbooks and worksheets in VBA.
Loop through each worksheet and delete all pivot tables by clearing their table ranges, removing data and the table structure.
Learn to add and arrange pivot fields in Excel using VBA, placing fields in rows, columns, and filters, adjusting positions, and formatting currency.
Learn to add calculated pivot fields in Excel using VBA, add a supplier attribute to the people table, and count suppliers to reveal exact totals.
Remove a pivot field from a people table using VBA, selecting by name or position, and verify that the field is removed.
Hide and remove all pivot fields in a pivot table using VBA, reposition and redefine fields, and execute updates to clear the layout.
Apply a filter to a single item in a field using VBA, clear existing filters, and verify the results by selecting a specific category such as fruit.
Apply a report filter for multiple items in Excel using VBA, selecting fruits and vegetables by category. Set the multiple page items property to true and view the filtered results.
Learn how to display or hide grand totals in the rows and columns using VBA, and observe how enabling or disabling grand totals affects what appears in your Excel tables.
Define and populate query tables in VBA by connecting to text data, specifying path and destination, importing data, and refreshing the table.
Learn how to work with the QueryTables collection in Excel using VBA, exploring reading and writing tables within worksheets, managing connections, and importing data from text files.
Learn to transfer an Excel range into a Microsoft Access database using ADODB VBA and SQL. Establish a connection, select a range, build insert statements, and execute the transfer.
Explore manipulating XML DOM nodes in VBA by working with nodelists, retrieving and replacing nodes, and tracking node positions to achieve consistent results.
Master manipulating XML attributes and tag names in VBA by navigating catalog nodes, accessing attributes, retrieving book and author details, and exploring child nodes and node properties.
Parse XML in VBA and get single nodes by using select single node, navigate through notes, worksheets, and tables, and extract data from the XML content.
Export a named Excel range to an XML file by creating a table, establishing a VBA connection and recordset, and streaming data to the XML file.
Import an XML file into an Excel range using ADODB by establishing a connection, creating a recordset on a worksheet, and transferring data into a table or named range.
Generate an xsd file with VBA from an Excel workbook, defining a book structure with fields like title and author, and integrate the schema with the workbook.
Learn how to work with MSXML node types in VBA by inspecting element, attribute, and text nodes, reading attributes and node values, and printing data.
Learn to send a soap request from Excel using VBA, set content type headers, receive the response, and parse and import the data into an Excel table.
Learn how to perform HTTP requests in Excel VBA to interact with websites or APIs, retrieve information, and handle responses using GET requests and response text.
Import json to excel using vba by fetching data from a web service and parsing it with a library, then map fields to worksheet headers like id, name, and city.
Export Excel data to a JSON file using VBA by building dictionaries, storing them in a collection, and writing the JSON output to a workbook directory.
This course has been created to teach how to turn an Excel workbook into a Database application using VBA.
Before creating the database application in the first sections I explain the main VBA data structures which are helpful to manage data to be imported to Excel and to be exported from Excel ranges to external sources e.g. databases, web services , XML files, text files and JSON files.
In details, the course includes:
Overview of VBA. Very important for those that are starting off with VBA. In this section the students will know how to access and know the Excel Developer Ribbon. the VBA Editor, the concept of macro and the concept of macro security and will get acquainted with topics e.g. the workbook object, worksheet object, cells and ranges. You will learn how to record a VBA macro. You will understand the VBA Project structure and composition, the Worksheet Module Code, the Workbook and Worksheet Properties and Methods, the General variables and subroutines, concepts e.g. Variables and Constants (Public and Private Variables), Subroutines and Functions (Public and Private Subroutines and Functions), User Defined Functions, VBA and Worksheet Modules and Variable Types and Declarations.
Manage Excel Tables with VBA. In this section you will learn what is an Excel table and how to prepare, format and manage it, how to the information contained in an Excel table, how to select areas of a table, how to insert rows,/columns/parts of a table, how to read and retrieve the elements of a table and how to manipulate and filter elements in a table.
VBA Dictionary: the students in this section will understand the VBA dictionary which is a modern data structure which can be also defined as a native object. The idea of dictionary starts from the Excel LOOKUP functions. We will see also how to verify and populate a Dictionary object, how to create a Dictionary as a Scripting object and as a generic object, how to add/remove Items and assign values to keys to a VBA Dictionary. We will discuss about how to check if a key exists and how to count the number of items in a dictionary. We will go through some case studies see how to read, sort and format dictionaries and how to manage dictionaries with arrays. Finally we will understand when to use a dictionary as a data structure.
VBA Collections: in this section we will see what a VBA collection is and what is the difference between collections and arrays. We will also see when to use collections and when to use arrays and their advantages and disadvantages. Then in details we will see how to create a collection and do operations on collection items (remove/remove all/add/get). we will then see how to verify if a key exists in a Collection and how to retrieve and count items in collections. Finally we will be able to convert a collection to an array.
Manager Pivot tables with VBA: this is an hot section where you will dominate Excel Pivot table with VBA, learning: how create/delete a pivot table, how to retrieve the list of pivot fields, how to do operations on the items of a pivot table (add/remove/filter/clear). We will get familiar with the difference between calculated and not calculated fields. We will see how to do some operations on the pivot tables: clear report filter, refresh, change data source range, layout and setup the grand totals.
Excel Query Tables and VBA: this is the section where you can learn how to import data from an Microsoft Access database, how to import from text file (fixed width/delimited), how to import several text files and CSV files into Excel Query Tables using VBA, how to append data from different text file to a Query Table. Finally we will see how to retrieve data From a website using a Query Table.
Exchange data with MS Access using VBA: we will have again an overview of how to export data from an Excel Query Tables to an Access database using VBA:
insert an Excel range of data into Access with ADODB VBA and SQL commands, insert an Excel range of data into Access with ADODB VBA with recordset, import Excel tables (listobjects) into Access with VBA, import Excel table (listobjects) into Access with VBA looping in the table data (SQL), import Excel tables (listobjects) into Access with VBA looping in the table data (recordset), update Access with Excel data with VBA.
Working with XML files in VBA: learn how to import XML into Query Table or in an Excel range, retrieve the DOM structure of an XML document and import elements, nodes and attributes into Excel files, how to breakdown an XML document and parse the single elements, how to identify nodes, elements, attributes and node lists. You will also learn to get XML elements and nodes using XPath. You will get familiar with the Excel VBA objects to manage XML documents e.g. MSXML, XMLDOM and XMLMap. We will see also how to import an XML file into an Excel range with ADODB and how to generate an XSD file with VBA. We will understand the MSXML node types and we will learn how to manage errors and attributes e.g. async.
Excel VBA and Web services: in this section the students have an overview of the SOAP and REST web services and how they are managed via VBA to send data to and from Excel files. In details: how to invoke a SOAP web service from Excel (do SOAP requests, WSDL, ...). In this section also: how to send HTTP requests with VBA from Excel with WinHttp, how to make REST call with VBA in Excel using the WinHttp object, how to get Http Request In Excel Vba. You will also have an overview of the IXMLHTTPRequest object.
Working with JSON files in VBA: JSON documents are another data structure to use for sending data over the internet through web services. In this section students will learn how to import JSON data to Excel workbooks and how to export data in Excel ranges to JSON documents. At the end students will be able also to generate nested JSON.
Miscellaneus: this is a bonus area where students will get more information about ODBC Queries, OLE DB Queries, how to import and export data from/to text files, how to do Web queries, how to manage VBA OLEObjects, how to parse HTML code in Excel with VBA and how to send automatic emails from Excel with VBA.
At the end students will be able to connect Excel with the rest of the world using the HTTP protocol, web services and database connections to import/export data using Excel data structures.
VBA is not dead with the evolution of the web applications, instead is evolving to offer more than we think.