Need help with amending a macro to pause.

ghrek

Active Member
Joined
Jul 29, 2005
Messages
427
Hi

I have the macro shown below and I need to add a few things to it but dont know where to start.

What it is when I have done the auto filter for each unique criteria on both sheets I need it to compare the totals between the two sheets and if both balance then OK nothing needs doing, If not I need it to compare the two sheets and highlight whats missing from sheet 2 on sheet 1.

After either command has been done I then need it to move onto next one but only when I push the space bar. I then need it to keep repeating its self all the way down each unique entry.

What I mean by comparing the totals is the totals of column D when all entries added together.

Code:
Sub Macro1()
'
' Macro1 Macro
'


'
    Rows("1:1").Select
    Application.CutCopyMode = False
    Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
    Selection.AutoFilter
    Sheets("Sheet1").Select
    Rows("1:1").Select
    Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
    Selection.AutoFilter
    ActiveSheet.Range("$A$1:$D$1056").AutoFilter Field:=1, Criteria1:="2096"
    Sheets("Sheet2").Select
    ActiveSheet.Range("$A$1:$D$1056").AutoFilter Field:=1, Criteria1:="2096"
     
    CHECK TO SEE IF BOTH TOTALS IN COLUMN D AGREE. 
    IF DO AGREE AWAIT SPACE BAR COMMAND TO MOVE ONTO NEXT ONE
    IF DONT AGREE HIGHLIGHT DATA THAT SHOWN ON SHEET 1 BUT NOT SHEET 2 THEN AWAIT SPACE BAR 
    COMMAND TO MOVE ONTO NEXT ONE
 
    Sheets("Sheet1").Select
    ActiveSheet.Range("$A$1:$D$1056").AutoFilter Field:=1, Criteria1:="2395"
    Sheets("Sheet2").Select
    ActiveSheet.Range("$A$1:$D$1056").AutoFilter Field:=1, Criteria1:="2395"


    CHECK TO SEE IF BOTH TOTALS IN COLUMN D  AGREE. 
    IF DO AGREE AWAIT SPACE BAR COMMAND TO MOVE ONTO NEXT ONE
    IF DONT AGREE HIGHLIGHT DATA THAT SHOWN ON SHEET 1 BUT NOT SHEET 2 THEN AWAIT SPACE BAR 
    COMMAND TO MOVE ONTO NEXT ONE


   And so on until I get to the last criterial number. There will be numerous criteria numbers so if poss I want it to loop rather than having to put each one in individually 




End Sub

Any Ideas?

Big thanks in advance
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
If can’t do that how do I have a macro that will only continue when I push the space bar?
 
Upvote 0

Forum statistics

Threads
1,223,243
Messages
6,170,971
Members
452,371
Latest member
Frana

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