Samples of Excel Macros in VBA

Home Page



The follwoing are samples of VBA code which are simple examples of the normal requirements required in business. No responsibility is taken for the use of the samples.



Extract of data from SQL Server
Add a Graph to a Workbook
Add a Range to a Workbook
Add & Delete a Worksheet in a Workbook
Copy a range in a Workbook
Add a new workbook to a Excel Application
Add border to a range of cells in Excel
Insert a Range Formulae in Excel
Insert cell Comment in Excel
Autofit columns in Excel
Sample Application - Fuel data format
Extract data from DB2 and format it
Execute worksheet functions in a Macro and use of the Range object
Write your own worksheet function
Parse text from Bank eStatement into Columns
Count rows in multiple worksheets ( could modify to total cell values in worksheets )
Generate data for a table for testing e.g. Pivot Table )
Load all Worksheet Names to an Array uses For Each
Download Example of Macros in Workbook spltting up transactions according to a code applied to each transaction. (This could be done in other ways, this is an example of macros)