LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 258
Default Global Variable

I am confused, I want to create a global variable called: bSELCTIONCHANGE. I
read through the other posts and thought that I had to place the global
variable before the Private Sub. But I get an error saying I have an Invalid
Outside Procedure. Where does the global variable belong? I have another
macro which sets bSELCTIONCHANGE to false to prevent the Private Sub from
running.


bSELCTIONCHANGE

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)

If bSELCTIONCHANGE Then

'Backup Board
If Not Application.Intersect(Target, Range("D5, D7, D9, D11, D13, D15,
D17, D19")) Is Nothing Then Sunday_Route_Selection.Show

'Relief Board
If Not Application.Intersect(Target, Range("D22, D24, D26, D28, D30,
D32, D34, D36, D38, D40, D42, D44, D46")) Is Nothing Then
Sunday_Route_Selection.Show

'Part Time Available
If Not Application.Intersect(Target, Range("D50, D52, D54, D56, D58,
D60, D62, D64, D66, D68, D70")) Is Nothing Then Sunday_Route_Selection.Show

'Overtime and Miscellaneous Assignments
If Not Application.Intersect(Target, Range("D86, D88, D90, D92, D94,
D96, D98, D100, D102, D104, D106, D108, D110, D112, D114")) Is Nothing Then
Sunday_Route_Selection.Show

'Routes To Cover
If Not Application.Intersect(Target, Range("D119:D147")) Is Nothing Then
Sunday_Routes_to_Cover.Show

End If

End Sub


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Global variable dhstein Excel Discussion (Misc queries) 2 October 30th 09 01:03 PM
Global Variable dhstein Excel Discussion (Misc queries) 4 July 26th 09 05:10 PM
why is it saying sheetcnt is "variable not defined" how to do a global variable to share over multiple functions in vba for excel? Daniel Excel Worksheet Functions 1 July 9th 05 03:05 AM
userform variable as global crew3407[_6_] Excel Programming 8 May 6th 04 04:38 PM
Global variable Don[_11_] Excel Programming 1 October 28th 03 04:15 AM


All times are GMT +1. The time now is 03:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"