-1

I have previously defined Report_wb in an module Obtain_Data, and now I am writing a new module Module1. I want to use the object Report_wb without defining it again. Is there any way to do that? Thanks!

  • If you make `Report_wb` public, then you can reference it in other modules as `Obtain_Data.Report_wb`. – xidgel Apr 25 '17 at 16:08

1 Answers1

0

rather than declaring Report_wb as a dim within a sub, write it as a public declaration at the top of the module

i.e.

'Module 1

Public stringTest as string

Sub SetString()
stringTest = "Hello World!"
End Sub

and then in another module:

'Module 2

Sub TestString()
call SetString
debug.print stringTest
End Sub
Zerk
  • 1,595
  • 9
  • 16