Hi Sam.
Try this
Sub DisplayMessageBox()
Dim iYesNo As Integer
iYesNo = MsgBox("Another Macro will now run", vbYesNo)
If iYesNo = vbYes Then
'Call other Procedure/Macro here
Else
Exit Sub
End If
End Sub
iYesNo = MsgBox("Another Macro will now run", vbYesNo) If iYesNo = vbYes Then 'Call other Procedure/Macro here Else Exit Sub End If
Great thank you. Just one question on the line 'Call other Procedure/Macro here' what would I actually put if the macro name is "replace". Also it might be in a different workspace. Thanks again for your help.
Sam
iYesNo = MsgBox("Another Macro will now run", vbYesNo) If iYesNo = vbYes Then 'Call other Procedure/Macro here Else Exit Sub End If
Call replace
As long as it's in the same workbook and it doesn't start with Private Sub. If it does start with private sub change it to Public Sub or just Sub. If it's in a differnt workbook it get more complicated, but it can be done.