Hi everybody,
Was wondering if anybody could help with the following code. Firstly, yes, I am very new to vb coding!
I have a listbox with an OK and Cancel button. I wanted the user to be able to double click their choice, as well as single click and then OK.
I'm not sure where to put the code. Any help would be appreciated.
Here is the code:
Private Sub Cancel_Click()
Unload Me
End Sub
Private Sub OK_Click()
Range("D65536").End(xlUp).Offset(1, 0).Value = List1
Unload Me
End Sub
Private Sub UserForm_Click()
End Sub
Private Sub Incident_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
Range("D65536").End(xlUp).Offset(1, 0).Value = List1
Unload Me
End Sub
Private Sub UserForm_Initialize()
With Incident
List1.AddItem "Congestion"
List1.AddItem "Extreme / Adverse Natural Event"
List1.AddItem "Air Quality"
List1.AddItem "Civil Unrest"
List1.AddItem "Motor Vehicle Crash"
List1.AddItem "Animal on Tollroad"
List1.AddItem "Illegal / Dangerous Driving Manoeuvres"
List1.AddItem "TCC Incident - Fire / Fire Alarm"
List1.AddItem "Prohibited Vehicle"
List1.AddItem "Overheight Vehicle"
List1.AddItem "Person on Tollroad"
List1.AddItem "Bomb Threat / Suspicious Package"
List1.AddItem "Spill / Debris"
List1.AddItem "Stationary Vehicle"
List1.AddItem "System Failure / Degradation"
List1.AddItem "Vehicle Fire"
List1.AddItem "Water Inundation"
List1.AddItem "Plant Fire / Fire Alarm"
List1.AddItem "Tunnel Evacuation"
List1.AddItem "Other / Miscellaneous"
End With
Exit Sub
End Sub
Thx in advance!
Bookmarks