UserForm Warning Message Box

Jan Kalop

Active Member
Joined
Aug 3, 2012
Messages
389
I have UserForm with some coding and would like to add Warning Message Box similar to the one is added in Macros.

The UserForm Code is:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

Dim X As Long

Dim E46 As Range: Set E46 = Range("E46")

If Target.CountLarge > 1 Then Exit Sub

If Not Intersect(Target, E46) Is Nothing Then
Application.ScreenUpdating = False
For X = 48 To 550
If Cells(X, 5).Value = E46.Value Then Cells(X, 4).Resize(, 112).Value = Range("D46:Dk46").Value
Next X

Application.ScreenUpdating = True
Set E46 = Nothing
End If

End Sub
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Warning Message Box similar to the one is added in Macros.
Sorry, that does not explain what you need.

What do you want the message box to say? Do you want to give the user options for what to do, or just show a message? Under what condition do you want the message box to appear?
 
Upvote 0
Sorry, that does not explain what you need.

What do you want the message box to say? Do you want to give the user options for what to do, or just show a message? Under what condition do you want the message box to appear?
Very simple "Yes" to confirme the proces or "No" to quit and like this one which I am using inthe Macros......sample
If MsgBox("Click OK to clear", _
vbOKCancel + vbQuestion) = vbCancel Then Exit Sub
 
Upvote 0

Forum statistics

Threads
1,214,985
Messages
6,122,602
Members
449,089
Latest member
Motoracer88

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