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
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