Hi,
Pls go through the userform in attached excel file.
"Add New Genre" Code is not working.
Thank you in advance
regards
shiva
Hi,
Pls go through the userform in attached excel file.
"Add New Genre" Code is not working.
Thank you in advance
regards
shiva
Syed_iqbal,
I get a red bar warning me not to open your file.
Mark
Hi,
Sorry, Now pls find the attached file.
regards
syed
Okay, you are using RowSource to populate the listbox with the (formula-driven) named range 'filmgener'. You cannot use .AddItem if you have linked the list boxes contents to a RowSource. Does that make sense?
Mark
Give this a try. Add the new item to sheet2 first then reassign listbox row source
Private Sub cmdnewgenre_Click() Dim r As Range If newgenre.Value <> "" Then Set r = Range("a2", Range("a2").End(xlDown)).Find(newgenre.Value) If r Is Nothing Then Sheet2.Range("a2").End(xlDown).Offset(1, 0).Value = newgenre.Value genrelst.RowSource = "filmgener" newgenre.Value = "" End If End If End Sub