confusion123
Active Member
- Joined
- Jul 27, 2014
- Messages
- 400
If you declared a variable within a standard module with Dim, that variable is only available within that module.
If you declared it at the top of the standard module, it's available throughout that module but not outside it.
If you declared a variable in a standard module at the top with Public, it is available throughout the entire workbook.
But if you declared a variable as Public in a Class Module (or worksheet or userform), is it still available throughout the entire workbook?
If so, what's the difference between declaring Public MyVar in a standard module v a class module (or worksheet or userform)?
Thanks
If you declared it at the top of the standard module, it's available throughout that module but not outside it.
If you declared a variable in a standard module at the top with Public, it is available throughout the entire workbook.
But if you declared a variable as Public in a Class Module (or worksheet or userform), is it still available throughout the entire workbook?
If so, what's the difference between declaring Public MyVar in a standard module v a class module (or worksheet or userform)?
Thanks