As I mentioned, you may have to dimension the variables as Global, or Public as:
Global A as Variant
Global HF as Variant
or
Public A as Variant
Public HF as Variant
I believe either one will work.
I think the problem is that regular DIMensioned variables are only available in
the Modules, or UserForms
where they are declared.
If I remember right, Global variables are available to all
modules/classes/UserForms in the Application.
Public variables are available to other MS Office Applications.
(I may have those reversed)
Nevertheless, that should solve the problem.