How to get a text to display on vba when a button is pressed?

797 views Asked by At
 Sum = Application.Sum(Range(Cells(12, 3), Cells(12, 82)))
 If Sum = 0 Then
    Enter = "Enter a value for  E"
    Exit Sub
 End If

So I am trying to get "Enter a value for E to pop up when the button is clicked. So far when the statement is true, nothing happens.

1

There are 1 answers

0
shruti1810 On

You can use MsgBox Enter after the line Enter = "Enter a value for E":

Sum = Application.Sum(Range(Cells(12, 3), Cells(12, 82)))
If Sum = 0 Then
    Enter = "Enter a value for  E"
    MsgBox Enter
    Exit Sub
End If