mardi 28 janvier 2020

Trying to link drop down menus with if statements in excel with C# code

I have been trying to use Validation.Add and if statements for a drop down list in cell A2 to be dynamic and add certain arraylists options dependent on cell A1.

I also cant find any code for it anywhere apart from maybe an Office2010 reference but I dont think it would work with the 2019 version.

       x.Range["A2"].Validation.Delete();
       x.Range["A2"].Validation.Add(Excel.XlDVType.xlValidateList, Type.Missing, 
       Excel.XlFormatConditionOperator.xlBetween, string.Join(",", arrayList.ToArray()));

Aucun commentaire:

Enregistrer un commentaire