Code needed to populate a message box during a macro
On Thursday, 4 April 2019 13:40:43 UTC+2, Claus Busch wrote:
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.
Dim ans As Integer
ans = MsgBox("Please check, if all data in the table is for the date in question!", _
If ans = vbNo Then
Application.Goto Sheets("downtime database").Range("A1")
thank you very much for your help!
It works kind off, but not yet 100% to my satisfaction.
I figured something else, what could make the appearance of a message box obsolete and what would actually be a better solution.
I am currently using this code in order to make a selection:
As you can see, it will ALWAYS select 22x3 cells, but it is not always 22 rows
which have to be selected.
I am also using a variable DateToFind
Dim DateToFind As Date
I basically have to select the 3 cells to the right of the DateToFind
There is a table, sorted by date. The dates are in Column A and every day can have various amounts of rows.
I have to select the 3 cells to the right of the variable DateToFind.
So, the DateToFind is in column A and there might be any number of entries, up
to 22 (behing each other, as it is sorted by date).
Hope I have expressed myself to be understood.