Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 11-18-2015, 02:42 AM
Officer_Bierschnitt Officer_Bierschnitt is offline Declaring a variable that is known across modules Windows 7 64bit Declaring a variable that is known across modules Office 2013
Advanced Beginner
Declaring a variable that is known across modules
 
Join Date: Oct 2015
Posts: 87
Officer_Bierschnitt is on a distinguished road
Default

Quote:
Originally Posted by Debaser View Post
If you declare a Public variable in a class module (for example a worksheet or ThisWorkbook module) then the variable may only be accessed as a member of that class. Therefore you must refer to it using syntax such as Sheet1.Variablename or ThisWorkbook.Variablename. If the variable is declared in a normal module, you may simply refer to it using its name from any other module in the workbook.
Ah. So, if I've understood you correctly, I have to create a new module in the workbook and declare all the variables as PUBLIC in that module and all other modules will recognize them.

I have already tried that. It seems to work. Let's see.

Best regards,

Officer_Bierschnitt
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Run Time Error '91': Object variable or With block variable not set using Catalogue Mailmerge Berryblue Mail Merge 1 11-13-2014 05:36 PM
Declaring a variable that is known across modules Modelling training modules Vincent Project 3 09-03-2014 05:37 PM
Declaring a variable that is known across modules Run-time error 91 object variable or with block variable not set JUST ME Word VBA 4 03-25-2014 06:56 AM
Declaring a variable that is known across modules Empty Modules Greg S. Excel Programming 2 07-30-2013 01:38 PM
Declaring a variable that is known across modules Run-time error '91': Object variable or With block variable not set tinfanide Excel Programming 2 06-10-2012 10:17 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:45 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft