Author: rahul.sadasivan | Posted on: 9/13/2010 6:29:18 AM | Views : 1328

Hi,
I am dynamically creating an excel file with some list options using C#. There will be 3 or more columns with drop down list. The issue is that in some columns there will not be values in some rows. But the drop down list shows all the empty column values also.
Is there a way by which I can filter the excel column with all non empty values?
Sample Code 
Range r = (Range)ExcelWS.Columns.get_Item(c.Ordinal + 1, Missing.Value);
r.Validation.Add(XlDVType.xlValidateList, XlDVAlertStyle.xlValidAlertStop, Missing.Value, "=$B:$B", Missing.Value);
r.Validation.ErrorMessage = "Please select from available options";
r.Validation.IgnoreBlank = true;
r.Validation.ShowError = true;
r.Validation.InCellDropdown = true;

 
...

Go to the complete details ...