VBA Comments

Updated: 01 November 2023

Sub MySub()
' A description of this Sub.
    Dim foo As String
    foo = "bar"
End Sub
Categories VBA

VBA Dictionaries

Updated: 06 October 2023

Access values in nested dictionaris

Debug.Print my_dict("key")("next_level_key")("and_next_level_key")


Updated: 24 October 2023


Use constants as a replacement for literal values. A constant is a named item that retains a constant value throughout program execution. Use constants anywhere, in place of actual values.

Public Const TEXT_HEIGHT As Long = 50


VarType Function

Categories VBA

Debug Word Shapes

Updated: 02 April 2023

Sub DebugShapes()
    Dim story_range As Range
    Dim my_shape As Shape

    For Each story_range In ActiveDocument.StoryRanges
        For Each my_shape In story_range.ShapeRange
            Debug.Print my_shape.Type & "; " & my_shape.ID & "; " & my_shape.Name
        Next my_shape
    Next story_range

End Sub
Categories VBA