Comparing 2 Excel Cell Values using C#
-
Hi, In my project there is a requirement to write the C# code in order to compare an excell cell value with an static value, Could you please help me for the following comparisions; (1) Checking if a paritcular cell value is blank or not (2) Checking if a particular cell value is equal to some static text. (3) Checking if a particular cell value starts with "Disc-". I tried to convert the excel cell value in to a string format and checked. string abc = excelCell[1, 2].ToString(); string abc1 = excelCell[2, 2].ToString(); if(abc==abc1) excelCell[1, 3] = "Equal"; else excelCell[1,3]="Not Equal"; Also i tried with out converting into string format i.e. i took only in the object format and tried but still could not succeed. Please help me. Regards, Vamsidhar
-
Hi, In my project there is a requirement to write the C# code in order to compare an excell cell value with an static value, Could you please help me for the following comparisions; (1) Checking if a paritcular cell value is blank or not (2) Checking if a particular cell value is equal to some static text. (3) Checking if a particular cell value starts with "Disc-". I tried to convert the excel cell value in to a string format and checked. string abc = excelCell[1, 2].ToString(); string abc1 = excelCell[2, 2].ToString(); if(abc==abc1) excelCell[1, 3] = "Equal"; else excelCell[1,3]="Not Equal"; Also i tried with out converting into string format i.e. i took only in the object format and tried but still could not succeed. Please help me. Regards, Vamsidhar
Good for you, please post on the correct forum if you want help. regards,
Jonathan Wilkes Darka [Xanya.net]