ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   combobox exit event (https://www.excelbanter.com/excel-programming/296646-combobox-exit-event.html)

Dave D[_3_]

combobox exit event
 
I seem to have created an endless loop.

Here is the code

Private Sub POVender_Exit(ByVal Cancel As
MSForms.ReturnBoolean)

With ActiveSheet
myvalue = Cells(1, 6)
i = 1
While (myvalue < Cells(i, 7) And (i <=
Module1.VendVal))
i = i + 1
Wend
If i Module1.VendVal Then
' We are adding a new Vendor
Cells(i, 7) = POForm.POVender.Text
Module1.AddVend = True
Else
Module1.VendRow = i
' set the rest of the textbox's
Module1.AddVend = False
End If
End With

End Sub

When there is a match in list the user hits the tab key
and the rest of the textbox's on the form are filled with
the info in the row. The loop happens when there is a
match. works fine if it was not in the list.


All times are GMT +1. The time now is 11:01 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com