SOLVED

yes no Selection button on a msgbox

Iron Contributor

I have the following code: 

 

Private Sub Worksheet_Change(ByVal Target As Range)
If Not (Application.Intersect(Range(" U30:U400"), Target) Is Nothing) Then
MsgBox "TURN OFF AUTO CALCULATE AFTER ALL 'ADDITIONAL SHARES' ARE ENTERED", vbInformation, " U R G E N T A L E R T "
End If
End Sub

 

Rather than generate an "ok" box I would rather have yes or no. 

 

example: msgbox Are you finished entering additional shares? 

if "no" then msgbox continues to pop up. If "yes" then the macro below will run:

 

Sub ManualCalculate()
'
' ManualCalculate Macro
'

'
Application.Calculation = xlManual
End Sub

 

Thank you in advance for you help with this.

 

 

 

 

2 Replies

Hi @Greg Bonaparte

 

Try this...

Private Sub Worksheet_Change(ByVal Target As Range)



If Not (Application.Intersect(Range(" U30:U400"), Target) Is Nothing) Then

    
    
  If MsgBox("HAVE YOU ENTERED ALL 'ADDITIONAL SHARES' ?", vbQuestion + vbYesNo, " U R G E N T A L E R T ") = vbYes Then
  
     Call ManualCalculate
  
  End If
  

End If

End Sub
best response confirmed by Greg Bonaparte (Iron Contributor)
Solution

This was perfect! Thank you Wyn.

1 best response

Accepted Solutions
best response confirmed by Greg Bonaparte (Iron Contributor)
Solution

This was perfect! Thank you Wyn.

View solution in original post