msgbox not working?

Trevor3007

Well-known Member
Joined
Jan 26, 2017
Messages
514
hi,

using the following to prompt the msgbox:-

Code:
Sub gototots()Range("AI4").Select
    Application.Goto Reference:="R999C34"
    ActiveWindow.SmallScroll Down:=-12
    Range("AI983").Select
    
   If MsgBox("Enter Yes to goto A174?", vbYesNo) = vbYes Then
 
Application.Goto Reference:="R117C1"
    ActiveWindow.SmallScroll Down:=54
    Range("A174").Select
   
Else


End If
End Sub
upon hitting the macro button It should goto AI983 , but would like it to pause say 10 seconds then run the 2nd msg to ask 'are you finished? If so enter Yes..
and it will goto A174 If No then wait 10 seconds & ask the question again?

MTIA
Trevor3007
 

Some videos you may like

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK

Logit

Well-known Member
Joined
Aug 31, 2016
Messages
3,251
.
Code:
Option Explicit


Sub gototots()
Range("AI4").Select
    Application.Goto Reference:="R999C34"
    ActiveWindow.SmallScroll Down:=-12
    Range("AI983").Select
    Application.Wait (Now + TimeValue("0:00:10"))
    
agn:
   If MsgBox("Enter Yes to goto A174?", vbYesNo) = vbYes Then
 
    Application.Goto Reference:="R117C1"
        ActiveWindow.SmallScroll Down:=54
        Range("A174").Select
       
    Else
        Application.Wait (Now + TimeValue("0:00:10"))
        GoTo agn:


    End If
End Sub
 

Trevor3007

Well-known Member
Joined
Jan 26, 2017
Messages
514
once again..logit sorts my issues!!

Nice one & very much appreciated.(y)
KR
Trevor3007
 

Watch MrExcel Video

Forum statistics

Threads
1,100,140
Messages
5,472,751
Members
406,835
Latest member
steve43040

This Week's Hot Topics

Top