Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
OK Im still trying to get a handle on the VBA methodology,
Ive now created some global subroutines that are not in Module3 and are called by the worksheet modules I have more than one Sub() in the module3. Many share the same variables Dim srcProgramDataInputWs As Worksheet as an example Where do I define Global variables that can be used throughout anywhere in the module What about a variable that can be used anywhere in any worksheet? This is what I have in one of my modules: Sub ReBuildProgramSummary(Optional Confirm As Boolean = True) ' '------------------------------------------------------------------------ ' Re-Build Program Summary Template '------------------------------------------------------------------------ '------- Main File Names used for this WorkBOOK --------------- '--*** Use Program Input Worksheet as a Master for changes *** '-------------------------------------------------------------- Dim srcProgramDataInputWs As Worksheet Dim srcProgramSummaryTemplateWs As Worksheet Dim srcProgramSummaryWs As Worksheet Dim srcBettingTemplateWs As Worksheet Set srcProgramSummaryTemplateWs = Sheets("@TemplateProgramSummary") Set srcProgramSummaryWs = Sheets("ProgramSummary") Set srcBettingTemplateWs = Sheets("@TempleteBetting") Set srcProgramDataInputWs = Sheets("ProgramDataInput") '-------------------------------------------------------------- '------- Set Variables to Workbook Names --------------- '--*** Use Program Input Worksheet as a Master for changes *** '-------------------------------------------------------------- If ActiveSheet.Name = srcProgramSummaryTemplateWs.Name Then MsgBox "Can't run from Template" Range("N3").Select Exit Sub End If ....more |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Global Variables | Excel Programming | |||
Global vs Local variables | Excel Programming | |||
How to put excel macros in a 'global' place. | Excel Programming | |||
Global Variables Not Accessible | Excel Programming | |||
Declaring Global Variables | Excel Programming |