VBAProIWish
Well-known Member
- Joined
- Jul 6, 2009
- Messages
- 1,027
- Office Version
- 365
- Platform
- Windows
Hello All,
I have code (provided by VoG, thanks again VoG!) within a large procedure that I don't always want to run.
Can I pop up a message box right before that block of code that says...
"do you want to add the numbers to the master report?"
If I say yes, the code runs, If I say no, is simply skips only that part of the code and continues on with the rest of the code in the procedure.
Nutshell Version,
Can this be done?
Thanks much!
I have code (provided by VoG, thanks again VoG!) within a large procedure that I don't always want to run.
Can I pop up a message box right before that block of code that says...
"do you want to add the numbers to the master report?"
If I say yes, the code runs, If I say no, is simply skips only that part of the code and continues on with the rest of the code in the procedure.
Nutshell Version,
Code:
regular code
regular code
[COLOR=red][B]message box "Do you want to add the numbers to the master report? (yes or no)[/B][/COLOR]
[B]VoG's code below runs ONLY if "yes" is selected[/B]
Dim Rng As Range
Dim wb As Workbook
Set wb = ActiveWorkbook
Set Rng = Range("a1").CurrentRegion
Set Rng = Rng.Offset(1, 0)
Set Rng = Rng.Resize(Rng.Rows.Count - 1)
Rng.Copy
On Error GoTo puke
Windows("History.xlsm").Activate
Range("A1").End(xlDown).Offset(1, 0).Select
ActiveSheet.Paste
Windows("History.xlsm").Visible = False
wb.Activate
puke:
END OF VoG's code
regular code (this code is continued on whether the message box is skipped or not)
regular code
Can this be done?
Thanks much!