Consulting | Excel Examples

Advanced Visual Basic for Applications Tutorial

Exporting Excel Data in Special Formats
You can use a VBA procedure to export data in comma delimited format. Or, change the delimiting character to export the data separated by semicolons, etc

Importing Text Files into Open Workbook
You can use either of two Visual Basic for Applications methods to automate the process of importing text into a workbook. The OpenText method controls all of the text import parameters from the Visual Basic Code. To give the user complete control over Text Import Wizard parameters, use the Dialogs (xlDialogsOpen).Show method .

Comparison of Three Sort Methods
You can sort an array by transferring it to the worksheet and using Excel's built in sort. Another sorting method is the Visual Basic for Applications "Bubble Sort". Quick Sort, adapted from the "Visual Basic Developers Guide" By D.F. Scott, is a third method. You can create a test array with random values and use the Timer method to compare the time required to perform the sort using each of the three methods.

[HRule Image]

Last modified: September 16, 2010