Hi,
How can i display a user selection in a message box:
User selection is stored in Range("A100")
Range("A100") = Batch
Sub ConfirmSelection()
Dim Response As VbMsgBoxResult
Response = MsgBox("Are you sure you want to delete Batch ..... ?" & vbCrLf & _
vbCrf & _
"This process is Irreversible!", vbCritical + vbYesNo, "Confirm Selection")
If Response = vbYes Then
'rest of code to delete
Thanks Again
Mohamed
Confirm Users Selection in Message Box
-
- 3StarLounger
- Posts: 366
- Joined: 12 May 2010, 06:49
-
- Administrator
- Posts: 78478
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Confirm Users Selection in Message Box
Use concatenation with the & operator:
Response = MsgBox("Are you sure you want to delete Batch " & Range("A100") & "?" & vbCrLf & _
vbCrf & _
"This process is Irreversible!", vbCritical + vbYesNo, "Confirm Selection")
Response = MsgBox("Are you sure you want to delete Batch " & Range("A100") & "?" & vbCrLf & _
vbCrf & _
"This process is Irreversible!", vbCritical + vbYesNo, "Confirm Selection")
Best wishes,
Hans
Hans
-
- 3StarLounger
- Posts: 366
- Joined: 12 May 2010, 06:49
Re: Confirm Users Selection in Message Box
Thanks Hans,
That was 110%
Kind Regards
Mohamed
That was 110%
Kind Regards
Mohamed