View Full Version : [SOLVED:] Is MsgBox Suitable ?
stuartgb100
02-08-2017, 01:22 PM
Hi,
Can I replace the standard ‘Yes’, ‘No’, and ‘Cancel’’ with
for example
‘Insert Rows’, ‘Delete Rows’ and ‘Cancel’ ?
Thanks.
Paul_Hossler
02-08-2017, 01:53 PM
No
Best way is to a) rephrase the question to fit the choices or b) make a user form that looks like a MsgBox with your own button text
a) is easiest
b) is not too difficult and can make a project look a little more polished
stuartgb100
02-08-2017, 10:30 PM
Paul.
Many thanks. Option a) then, I think.
Regards.
Paul_Hossler
02-09-2017, 06:48 AM
18303
That's usually the easiest to build and to maintain
Option Explicit
Sub drv()
Dim Ans As VbMsgBoxResult
Ans = MsgBox("Click ..." & vbCrLf & vbCrLf & _
"[Yes] to Insert Rows," & vbCrLf & _
"[No] to Delete Rows, or" & vbCrLf & _
"[Cancel] to Exit without doing anything", _
vbDefaultButton3 + vbQuestion + vbYesNoCancel, "MsgBox Demo")
Select Case Ans
Case vbYes
Case vbNo
Case vbCancel
End Select
End Sub
stuartgb100
02-09-2017, 11:17 AM
Paul,
Thanks again.
That will do nicely.
Regards.
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.