Visual Basic in Excel Instruction and function manual

Alan McNutt 0 Reputation points
2026-08-24T00:24:50.74+00:00

I am having trouble finding basic information on instructions with detailed syntactical rules and similarly a list of functions in Visual Basic. EG... where do I find the exact syntax for dimensioning an array and declaring a range of cells as an array in Visual Basic ? What is the function name and syntax for string concatenation function ? Your "Language Reference Manual" doesn't seem to have a list or other methodical way to search for these things. I have written VBA applications before, but just need a reminder of what instructions and functions are available.

Developer technologies | Visual Basic for Applications

Answer recommended by moderator

AI answer

2026-08-24T00:25:09.1166667+00:00

For VBA syntax and function lookup, the most methodical starting points are the Visual Basic language reference and the broader Language reference for Visual Basic for Applications (VBA). Those references organize VBA content by statements, functions, operators, objects, data types, and conceptual topics.

For the specific examples mentioned:

  • Dimensioning an array uses the Dim statement with parentheses for arrays:
Dim myArray()

The documented syntax is:

Dim varname [(subscripts)] [As type], [varname [(subscripts)] [As type]] ...

Examples from the syntax guidance:

Dim myVar, nextVar, thirdVar
Dim myAnswer As String
Dim x As Integer, y As Integer, z As Integer
Dim myArray()

Key rule: if declaring an array variable, parentheses must be included; subscripts are optional.

  • Function and method syntax rules are explained in the Visual Basic syntax topic. It shows how required elements, optional arguments in brackets, placeholders in italics, and keywords in bold are represented.
  • Named and positional arguments are also supported. For example, MsgBox can be written by position:
MsgBox "Your answer is correct!",0,"Answer Box"

or by name:

MsgBox Title:="Answer Box", Prompt:="Your answer is correct!"
  • Parentheses rules matter when calling functions. If the return value is used, arguments must be enclosed in parentheses. Example:
myVar = MsgBox(Prompt:="I enjoy my job.", _
    Title:="Answer Box", Buttons:="4")

If the return value is ignored, the syntax guidance says not to include the parentheses.

For finding available instructions and functions efficiently, use these sections in the VBA reference:

  • Functions for built-in VBA functions
  • Statements for instructions such as Dim
  • Operators for language operators
  • Data types for declaration details
  • Visual Basic conceptual topics for syntax rules, arrays, scope, variants, and related topics
  • User Interface Help in the VBA reference, which includes Visual Basic Editor elements and an error messages section with common causes and solutions

If the goal is a reminder of what exists rather than a tutorial, the best navigation path is:

  1. Open Language reference for Visual Basic for Applications (VBA).
  2. Go to Visual Basic language reference.
  3. Browse Functions, Statements, Operators, and Data types.
  4. Use Visual Basic conceptual topics for syntax patterns such as arrays, named arguments, optional arguments, and parentheses.

For help inside the editor, the Visual Basic Editor help article also points to help resources available while using the editor.


AI-generated content may be incorrect. Read our transparency notes for more information.

Was this answer helpful?

1 person found this answer helpful.

2 additional answers

Sort by: Most helpful
  1. Tony Thach (WICLOUD CORPORATION) 560 Reputation points Microsoft External Staff Moderator
    2026-08-24T03:11:25.0933333+00:00

    Hi @Alan McNutt ,

    Thank you for raising this thoughtful and very practical question. Your experience with VBA is evident from the way you identified exactly what is missing: not another introductory tutorial, but a clear and systematic reference for quickly reviewing the language. We sincerely appreciate your continued interest in VBA and the opportunity to help make the documentation easier to navigate.

    I agree that Microsoft Learn can be difficult to navigate when you simply need a traditional reference manual to refresh your memory. Microsoft Learn organizes VBA documentation into separate categories rather than presenting everything in one consolidated instruction and function list.

    The best starting point is VBA Language Reference

    From there, use these sections depending on what you need:

    • Statements for instructions such as Dim, If, For, Select Case, and ReDim
    • Functions for built-in functions such as Left, Mid, InStr, Replace, and Join
    • Operators for arithmetic, comparison, logical, and string operators
    • Data types for String, Integer, Long, Variant, and other types
    • Conceptual topics for arrays, variables, scope, procedures, and general language rules

    The notation used in the syntax descriptions is explained at Understanding Visual Basic syntax

    For your specific array examples:

    
    ' Fixed-size array
    
    Dim values(1 To 10) As Integer
    
    ' Dynamic array
    
    Dim values() As Integer
    
    ReDim values(1 To 10)
    
    ' Read a range into a Variant containing a two-dimensional array
    
    Dim values As Variant
    
    values = Worksheets("Sheet1").Range("A1:A10").Value
    
    

    The relevant references are:

    For string concatenation, VBA normally uses the & operator rather than a function:

    
    fullName = firstName & " " & lastName
    
    

    To combine the elements of a one-dimensional string array, use the Join function:

    
    result = Join(values, ",")
    
    

    References:

    A practical way to search Microsoft Learn is to include the category and feature name, for example:

    • VBA Dim statement
    • VBA Join function
    • VBA operator summary
    • VBA declaring arrays

    This normally leads directly to the syntax, parameters, remarks, and examples for the required language element.

    You are correct that this organization is less discoverable than a traditional alphabetical reference manual, especially for an experienced developer who already knows the concept and only needs to confirm the exact syntax. I hope the reference page and navigation approach above provide the quick lookup experience you were seeking. Thank you again for your valuable feedback and for continuing to use VBA.

    If this instruction is applicable to your situation, I would greatly appreciate it if you could follow the instruction here so others experiencing similar behavior can benefit from it as well.

    Was this answer helpful?

    2 people found this answer helpful.

  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.