adding a message box to a VBA code??

zilch4ry

Board Regular
Joined
Feb 27, 2011
Messages
76
hi all,

Im have written a very complex vba code (i know lol) but i cannot seem to find anyhelp on google saying how you would put in a message box saying something like "are you sure you want to continue?" with the answers being "yes" and "no"

If anybody could help me with this, it would be very appreciated

My complex code ;) ::

Code:
Sub foo()
Dim i As Long
Application.ScreenUpdating = False
For i = 7 To 16 Step 3
    With Range(Cells(15, i), Cells(21, i + 2))
        .Copy Destination:=Range(Cells(6, i), Cells(12, i + 2))
        .ClearContents
    Range("I6:I12").Select
    Selection.Copy
    Range("I15:I21").Select
    ActiveSheet.Paste
    Range("L6:L12").Select
    Application.CutCopyMode = False
    Selection.Copy
    Range("L15:L21").Select
    ActiveSheet.Paste
    Range("O6:O12").Select
    Application.CutCopyMode = False
    Selection.Copy
    Range("O15:O21").Select
    ActiveSheet.Paste
    Application.CutCopyMode = False
    End With
Next i
Application.ScreenUpdating = True
End Sub

Thanks everyone
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December

Forum statistics

Threads
1,224,578
Messages
6,179,652
Members
452,934
Latest member
mm1t1

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