Class Event for ComboBox Enter (Excel 2013)
I'm falling short with finding any info to help me with a userform issue. I have 14 comboboxes on a userform that are named "PDFLink1" through 7 and "MDLink1" through 7. I'm using the Enter event to open the FileDialog and place the selected file path into the comboboxes. I was trying to create a class event for the Enter event rather than create 14 individual events. But there isn't a Enter event with the WithEvents function, and for some reason I am unable to get the Click event in the userform module to work, which is why I am using the Enter event.
I don't have any of the Class code to put on here because I was stuck at the very beginning since the Enter event is not available when using WithEvents. But below is just the code for Enter event on the userform module. Just wondering if there is any way around this.
Thanks for the help!
Code:
'INSERT PDF LINK #1
Private Sub PDFLink1_Enter()
Dim fDialog As FileDialog, result As Integer
With ENGForm
If .PDFLink1.Value = "" Then
Set fDialog = Application.FileDialog(3)
With fDialog
.AllowMultiSelect = False
.Title = "Select File"
.InitialFileName = "F:\"
.Filters.Clear
If fDialog.Show = -1 Then
ENGForm.PDFLink1.Value = .SelectedItems(1)
End If
End With
End If
End With
End Sub