Introduction

This set of pages is intended for those who have an existing interest in VBA coding. It provides working code that the author himself finds of interest. Many of the procedures have good generality, for example, code for logging data, returning a file address, hashing, and others.

In most cases the code of each page can be copied into a standard VBA Excel module, though in many cases will work in other Office applications, with or without slight modification.

VBA Editor Settings

Because users' computers vary as to the Windows applications installed, it might be helpful to know which References have been set in the Tools menu of the authors' VBA editors. Authors who add to the work should update any of theirs to the list. These currently include:

  • Visual Basic for Applications
  • Microsoft Excel 14.0 Object Library
  • Microsoft Office 14.0 Object Library
  • OLE Automation
  • Visual Basic for Applications Extensibility 5.3
  • mscorlib.dll
  • Microsoft Scripting Runtime
  • Microsoft Forms 2.0 Object Library
  • Microsoft Speech Object Library

In addition, it has been found most useful to set the ShowModal property of userforms to False. This allows the testing of code when the userform is still open, for example to step through the code line by line. This also allows keyboard interaction with the worksheet without closing the form.

Selecting Long Listings

Some code listings or data sets can be very long on a web page. As such, just selecting the intended text can be quite time consuming. Most browsers however have a way to select all of a page's text right up to the end.

  • Microsoft Edge and Firefox have right context menus with Select All. After selection, use copy to get the whole page. It is then an easier task to trim the pasted selection to its essential parts.
  • Opera Browser has no right context function for Select All . Instead, use the key combination Ctrl+A.

Interest Areas

The following pages are offered as a starting point to get things going. Contributors are invited to edit and add to these pages, and to add new ones. I hope to fill in a bit more of the textual descriptions in the near future.

Arrays (1D) for Characters

Arrays (2D)

Charts

Clipboard

Codes and Ciphers

Error Handling

Files and Folders

Fonts and Formats

Games

Hashing Strings and Files

Logs and Text Files

Message and Input Boxes

Numbers

Range

Sorting

Sound

Statistics

String and Array Shuffles

Text Backup and Validation

Times, Dates, and Waits

User Forms

VBA Editor Projects

Viterbi Project

Procedures for MS Word

Worksheet Transfers

Worksheet Utilities

ASCII Log Data from LAS File

This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.