# Excel pop message



## lakshmidudgikar (Jan 1, 2023)

Hello Experts

I am pretty new to excel and so I need help.. 

Background:

So I am creating a template where I have listed around 11 questions. So after 2nd question I need to give a pop up window stating " This change is XYZ" . 

To clarify more the condition would be like

 If 2nd question  values is like 'A, B Or C'
 then 
"This change is XYZ"
Else
"This change is PQR"
End

Would be great ful if you could help me to solve this issue. 

Thank you in advance


----------



## 6StringJazzer (Jan 1, 2023)

What do you mean "after 2nd question"? Do you mean after the user answers the second question? How are they providing their answer? 

The only way I know of to give a pop-up window, other than data validation if they enter invalid data, is by using VBA. You would put code like this in the module for the sheet containing the questions:

```
Private Sub Worksheet_Change(ByVal Target As Range)

   If Target.Address = "$A$1" Then ' replace A1 with actual cell
      If Target = "A" Or Target = "B" Or Target = "C" Then
         MsgBox "This change is XYZ"
      Else
         MsgBox "This change is PQR"
      End If
   End If
   
End Sub
```


----------



## lakshmidudgikar (Jan 2, 2023)

6StringJazzer said:


> What do you mean "after 2nd question"? Do you mean after the user answers the second question? How are they providing their answer?
> 
> The only way I know of to give a pop-up window, other than data validation if they enter invalid data, is by using VBA. You would put code like this in the module for the sheet containing the questions:
> 
> ...


Thank you for the quick revert. 

Yes I meant after user answers the 2nd question. 

Let me try this out and would come back. 

Thanks


----------

