Hello,
I hope I am posting this in the right area.
I am using Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range) and a Case Statement that looks for a cell change, that calls a macro based on the value.
I originally started out with the MsgBox Function to get all the case statements setup, to later add the macro's. It worked fine until I added the first macro.
It calls the macro fine, but it keeps repeating the If statement: MsgBox("Email the Buyer?", vbYesNo) , until I select No. Otherwise each time I select yes, it runs the macro over and over again until I select No.
All the MsgBox functions work fine and i thought it would be easy enough to just go back through and replace the MsgBox Okay Then!, with a Call statement to a Macro.
Can someone please show me the error of my ways?
Thanking you in advance for your time.
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Select Case Range("CC26")
Case "Email the Buyer"
If MsgBox("Email the Buyer?", vbYesNo) = vbYes Then
Call BuyerEmailsGeneral
' MsgBox "okay then!"
End If
Range("CC26").Value = "Click here to generate a new email"
Case "Email the Seller"
If MsgBox("Email the Seller", vbYesNo) = vbYes Then
MsgBox "okay then!"
End If
Range("CC26").Value = "Click here to generate a new email"
Case "Email the Other Agent"
If MsgBox("Email the Other Agent", vbYesNo) = vbYes Then
MsgBox "okay then!"
End If
Range("cc26").Value = "Click here to generate a new email"
End Select
Display More