So I have a UserForm that works, except for the close button. I have the simple close code...
Private Sub vbClose_Click()
Unload Me
End Sub
But when that part runs, another Private Sub kicks off for some reason...
Private Sub ComboBox_AfterUpdate()
Dim myRng As Range, VIT As Workbook, Sheet As Worksheet, LastRow As Long, myCol As String, LastCol As Long
Dim Loc As Range, CLoc As String, ANLoc As String, CurLoc As String
Set VIT = Workbooks("Workbook.xlsm")
Set Data = Sheets("Sheet")
LastCol = Data.Range("A1").CurrentRegion.Columns.Count
myCol = GetColumnLetter(LastCol)
LastRow = Data.Range("B" & Rows.Count).End(xlUp).Row
Set myRng = Range("H2:H" & LastRow)
Set Loc = myRng.Find(What:=Fund.Value, LookIn:=xlValues)
If Loc.Offset(0, -5).Value = Pool.Value Then <--------- line that breaks
CLoc = Loc.Offset(0, 60)
Cusip.Caption = Format(CLoc, "000000000")
ANLoc = Loc.Offset(0, 40).Value
AcctNum.Caption = Format(ANLoc, "0000")
CurLoc = Loc.Offset(0, 11)
CurrLabel.Caption = CurLoc
Else
Set Loc = myRng.FindNext(After:=Loc)
CLoc = Loc.Offset(0, 60).Value
Cusip.Caption = Format(CLoc, "000000000")
ANLoc = Loc.Offset(0, 40)
AcctNum.Caption = Format(ANLoc, "0000")
CurLoc = Loc.Offset(0, 11)
CurrLabel.Caption = CurLoc
End If
End Sub
Any help is appreciated as to why.