Superbum138
New Member
- Joined
- Dec 1, 2017
- Messages
- 2
I am trying to get a message box to fire automatically based on a cell value. Here is the setup:
I have a "configurator" tab (Sheet 2) that has an ActiveX drop down box with a list of names that corresponds to a table of names/job titles on a logic tab (Sheet 3). When you select your name on the ActiveX control the, cell link changes the value based on the name selected i.e. if the third name is selected the control will put 3 in the linked cell. This value is then used by a Vlookup to add the person's name and title to a output letter. There is no issue with this function.
What I would like to do is make the sheet fire a message box when a specific user is selected from the drop down box. If Jon Doe was the 17th on the list then I want a message box to fire that says Hello Jon Doe!
What I did was link a cell on the configurator sheet to the ActiveX cell link value on the logic sheet so whatever number was displayed on the logic sheet would also be displayed on the configurator sheet so that my VBA code could run within that sheet and not have to call other sheets.
The issue resides that the cell I am trying to use to fire the message box contains the formula =Logic!D1627 so being a formula driven value I cannot simply use Worksheet_Change(ByVal Target As Range) as this requires a manual change to trigger.
I have the code:
Private Sub Worksheet_Calculate()
If [G14] = 17 Then
MsgBox "Hello Jon Doe!"
End If
End Sub
Which works but it fires every time you click anywhere in the sheet now. How can I have this message box fire only once unless that value in G14 changes again?
I have tried:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim A As Range
Set A = Range("G14")
If Intersect(Target, A) Is Nothing Then Exit Sub
If Target.Value = 17 Then
MsgBox "Hello Jon Doe!"
End If
End Sub
But this requires a manual change not a formula driven value.
I am stumped.
I have a "configurator" tab (Sheet 2) that has an ActiveX drop down box with a list of names that corresponds to a table of names/job titles on a logic tab (Sheet 3). When you select your name on the ActiveX control the, cell link changes the value based on the name selected i.e. if the third name is selected the control will put 3 in the linked cell. This value is then used by a Vlookup to add the person's name and title to a output letter. There is no issue with this function.
What I would like to do is make the sheet fire a message box when a specific user is selected from the drop down box. If Jon Doe was the 17th on the list then I want a message box to fire that says Hello Jon Doe!
What I did was link a cell on the configurator sheet to the ActiveX cell link value on the logic sheet so whatever number was displayed on the logic sheet would also be displayed on the configurator sheet so that my VBA code could run within that sheet and not have to call other sheets.
The issue resides that the cell I am trying to use to fire the message box contains the formula =Logic!D1627 so being a formula driven value I cannot simply use Worksheet_Change(ByVal Target As Range) as this requires a manual change to trigger.
I have the code:
Private Sub Worksheet_Calculate()
If [G14] = 17 Then
MsgBox "Hello Jon Doe!"
End If
End Sub
Which works but it fires every time you click anywhere in the sheet now. How can I have this message box fire only once unless that value in G14 changes again?
I have tried:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim A As Range
Set A = Range("G14")
If Intersect(Target, A) Is Nothing Then Exit Sub
If Target.Value = 17 Then
MsgBox "Hello Jon Doe!"
End If
End Sub
But this requires a manual change not a formula driven value.
I am stumped.