Understanding the Basics of Excel VBA Macros

🏷 ["miscellaneous"]

This is an example post and will not have detailed explanations. It is intended to be a notebook for me to revisit concepts related to VBA from time to time.

Function fname (a As Double, b As Double) as Double
    ***
    ***
    fname = result
End Function
{
    "Application":{
        "Addin":{},
        "Window":{},
        "WorksheetFunction":{},
        "Workbook":{
                    "Chart":{},
                    "Name":{},
                    "VBProject":{},
                    "Window":{},
                    "Worksheet":{
                                   "Comment":{},
                                   "Hyperlink":{},
                                   "PageSetup":{},
                                   "Range":{}
                                }

                   }
    }
}
Range("A1:A4").Copy Range("C1:C4")
On Error GoTo Here
code
Here:
code
If condition Then
    code
Elseif condition2 Then
    code
Else
    code
End If

For Next Loop

Dim sum as Double
For i = 1 to N
    sum = sum + 1
Next i

Do Loop

Do
    code
    If condition Then Exit Do
    code
Loop