• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Global constant doubt in VBA.

Jagdev Singh

Active Member
Hi Experts,

I have a doubt regarding constant variable.

I want to provide an input box to a variable as per the below code.

Dim strFldr As String

strFldr = InputBox("Please add folder link of the doc")

I want to use the same URL in 2 class or 1 class and 1 function is the module.

Regards,

JD
 
You would put the definition for your variable at the top of a module, before any subs, as:
Code:
Public strFldr as String

'Rest of code follows
Sub SetValue()
strFldr = InputBox("Please add folder link of the doc")
End Sub
 
Back
Top