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: 11
Default Passing a Variable from Worksheet to Workbook

I have a Sheet with several comboboxes (with linked cells). When the user
leaves the workbook I need to display a message if they have made changes to
any of the combo boxes. Each has a change event like below......
The first line just fills in a default if it is null
The second line forces the worksheet change event which determines if the
change is for one of the designated cells and sets the value of blnchgseg to
True.

Now I need to ..... If blnchgseg = True Then SegMsg (display the
message)..... but the workbook does not know about blnchgseg and the
worksheet_deactivate does not fire when the user move to another workbook.

Can I define a static variable so both worksheet and workbook know about it
?
Have I gone 'round the bend on this one????

Private Sub ComboBox1_Change()
If IsNull(Me.ComboBox1) Then Me.ComboBox1 = Range("aY7")
Worksheet_Change Range(Me.ComboBox1.LinkedCell)
End Sub


Private Sub Worksheet_Change(ByVal Target As Range)
Static blnchgseg As Boolean
For intx = 1 To Range("trsegsmapped").Rows.Count
If Target.Address = Range("trsegsmapped")(intx).Address Then
blnchgseg = True
Exit For
End If
Next intx
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
Passing Variable Number of Arguments to a Sub blatham Excel Discussion (Misc queries) 4 December 10th 05 10:36 AM
Passing Variable to LINEST RW Excel Worksheet Functions 5 May 24th 05 07:00 PM
passing a variable as an argument to a function Drew[_6_] Excel Programming 3 July 25th 03 08:51 PM
UserForm not passing Boolean variable Chip Pearson Excel Programming 2 July 19th 03 06:06 PM
Passing a value to a variable from Userform Neal Steiner Excel Programming 1 July 18th 03 09:12 PM


All times are GMT +1. The time now is 10:25 PM.

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

About Us

"It's about Microsoft Excel"