Tips for golfing in Visual Basic This page is not for Visual Basic .NET Tips or VBA tips
Visual Basic (VB or VB6) is an object-oriented and event-driven dialect of basic that was developed and released by Microsoft in 1991. The last release of Visual Basic came as Visual Basic 6.0 in 1998, and the language was declared a legacy language in 2008. Visual Basic .NET replaced Visual Basic in 2002.
All answers on this site that are written in Visual Basic are assumed to be written for Visual Basic 6.0 unless otherwise stated.

Some helpful links

MSDN Visual Basic 6.0 Resource Center

Visual Basic Wiki



You may compile and execute Visual Basic code using Visual Studio Community.
There is no online resource for compiling VB code.
Use DefXXX statements when declaring multiple variables

The statement
DefDbl A-D

Defines all variables that start with A through D as being of the type Double, which means this can shorten cases such as
Dim A As Double
Dim B As Double
Dim C As Double
Dim D As Double

Similar commands exist for the following types
DefBool     ''  Boolean
DefByte     ''  byte
DefCur      ''  Currency
DefDate     ''  Date
DefDbl      ''  Double
DefDec      ''  Decimal
DefInt      ''  Integer
DefLng      ''  Long
DefObj      ''  Object
DefSng      ''  Single
DefStr      ''  String
DefVar      ''  Variant