Pause macro, continue every time a press yes

mergim

New Member
Joined
Nov 24, 2020
Messages
49
Office Version
  1. 365
Platform
  1. Windows
Hello Guys,

I'm trying to do this code, where for every step of the macro, you have to choose whether to continue or not.
Right now, my code is looking up a value in a database, and there are around 50 values to look up. I want my code to run, so it pauses in between each and every value, and first be able to continue to the next value, as soon as I have pressed continue. It has ofc to continue from where it stopped/paused and not start all over again.
The reason I want it to pause in between look ups, is because I want to take notes in another excel doc. I have tried with a msgbox, but I cannot take notes if the msgbox is popped up.
Thanks guys!

VBA Code:
Windows("111 - 1 storage Req Total.xlsx").Activate
    ActiveSheet.Range("$A$1:$N$33114").AutoFilter Field:=2, Criteria1:= _
        "Polymer 123456789"
'' pause
'continue
    Windows("111 - 1 storage Req Total.xlsx").Activate
    Range("B1").Select
    ActiveSheet.Range("$A$1:$N$33114").AutoFilter Field:=2, Criteria1:= _
        "Polymer 123456789"
' pause
'continue
   
    Windows("111 - 1 storage Req Total.xlsx").Activate
    ActiveSheet.Range("$A$1:$N$33114").AutoFilter Field:=2, Criteria1:= _
        "Polymer 123456789"
 'pause
 
'continue
 
    Windows("111 - 1 storage Req Total.xlsx").Activate
    ActiveSheet.Range("$A$1:$N$33114").AutoFilter Field:=2, Criteria1:= _
        "Polymer 123456789"
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
If you open up a separate session of excel you could use the MsgBox technique in session one to pause, and still work in another spreadsheet while paused in session 2.

 
Upvote 0
If you open up a separate session of excel you could use the MsgBox technique in session one to pause, and still work in another spreadsheet while paused in session 2.

Hello,

That is what I have been trying to do, but it doesn't work unfortunately.
The msgbox forces me to either to press "yes" or "no" before I can go into another document.
 
Upvote 0

Forum statistics

Threads
1,214,620
Messages
6,120,559
Members
448,970
Latest member
kennimack

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top