declaring on top of the module
variable a will be recognized in the enire module
Dim a as string
a = "string"
public ==> variable lives as long as workbook is open
Public a As String
a = "ert"
Sub bb() 'can be in other module
some experts will tell you to avoid public variables
you can use instead "calling procedures with arguments"
Call macro(1, 3)
Call macro(2, 5)
Call macro(99, 101)
Sub macro(var1 As Integer, var2 As Integer)
MsgBox var1 & " + " & var2 & " = " & var1 + var2
'or just use
'macro 1, 3