View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Claus Busch Claus Busch is offline
external usenet poster
 
Posts: 3,872
Default Code needed to populate a message box during a macro

Hi Norbert,

Am Thu, 4 Apr 2019 04:19:53 -0700 (PDT) schrieb Norbert:

can someone please help me with some code which I'd like to insert into a macro of mine, which populates a message with text "Please check, if all data in the table is for the date in question!"
There should be a Yes and a No button available (if that is possible).
Yes, should make the macro to run again but the No should take the person to that
particular table in the macro, where the macro is busy at that moment in time.
In other words, the macro should change the view to the current worksheet on which it is busy at that particular moment in time.


try:

Dim ans As Integer

ans = MsgBox("Please check, if all data in the table is for the date in question!", _
vbYesNo, "Warning")

If ans = vbNo Then
Application.Goto Sheets("downtime database").Range("A1")
Exit Sub
End If


Regards
Claus B.
--
Windows10
Office 2016