VBA Global Variables | How to Declare Global Variable in VBA?
To make the variable available for all the Sub procedures across all the modules, we need to declare the variable at the top of the module not by using the word "Dim" but by using the name "Public" or "Global.". In the above image, we have used the word "Public" to declare the variable instead of our veteran word "Dim.".