Wishful Thinking
New Member
- Joined
- Dec 31, 2023
- Messages
- 6
- Office Version
- 365
- Platform
- Windows
Here is my code on Sheet1 (Checkbook Ledger). However, per my code below, in range "B2:B1000" If "B2" is "Credit Card" I get the correct pop up - If "B3" is "License" then I get the correct popup. However after that "B4:B1000" I get the pop up associated with "License" regardless of the keyword inputted. Therefore, I only want the msgbox associated with the keyword (ex: "License" or "Credit Card") to pop up with associated msgbox. If neither of the keywords are found, I don't want any pop up to show. Also, I may find an additional keyword in range "B2:B1000" that I would like to have another pop up msgbox. What am I missing in the code to make it do what I want. Thanks for taking a look and if you need additional info, let me know.
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Target.Column = 2 Then Exit Sub
If Not Range("B2:B1000").Find(What:="License", LookIn:=xlValues, LookAt:=xlWhole, MatchCase:=True) Is Nothing Then
MsgBox "Separate The Cost Of The Tag And The Cost Of The Property Tax - Then Create A Separate Entry For The Property Tax"
Exit Sub
End If
If Not Target.Column = 2 Then Exit Sub
If Not Range("B2:B1000").Find(What:="Credit Card", LookIn:=xlValues, LookAt:=xlWhole, MatchCase:=True) Is Nothing Then
MsgBox "Separate The Cost Of Each Item - Create Separate Entries For House, Gas, Food, Vacation"
Exit Sub
End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Target.Column = 2 Then Exit Sub
If Not Range("B2:B1000").Find(What:="License", LookIn:=xlValues, LookAt:=xlWhole, MatchCase:=True) Is Nothing Then
MsgBox "Separate The Cost Of The Tag And The Cost Of The Property Tax - Then Create A Separate Entry For The Property Tax"
Exit Sub
End If
If Not Target.Column = 2 Then Exit Sub
If Not Range("B2:B1000").Find(What:="Credit Card", LookIn:=xlValues, LookAt:=xlWhole, MatchCase:=True) Is Nothing Then
MsgBox "Separate The Cost Of Each Item - Create Separate Entries For House, Gas, Food, Vacation"
Exit Sub
End If
End Sub