S
Susan Lammi
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
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