View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
[email protected] ldiowa@gmail.com is offline
external usenet poster
 
Posts: 24
Default Set value of a cell with a dropdown list during run time (C#)

On Wednesday, August 14, 2013 10:05:38 AM UTC-5, GS wrote:
Hi there, I have a excel file that has dropdown list in a cell. I want to programatically set the value of the cell using following code and did not work. oSheet.Range["A1"].Value = "A1"; The same code works for a regular cell. Looks like that the dropdown listitems were from another sheet. Thanks very much for your help. Hugh As I mentioned in your other thread.., the value you're trying to enter in a DV cell must be in the DV List. Otherwise, it doesn't work! Try assigning one of the list items! -- Garry Free uenet access at http://www.eternal-september.org Classic VB Users Regroup comp.lang.basic.visual.misc microsoft.public.vb.general.discussion



First, thanks very much for your help again. Yes, the value entered is one of the DV list items. But it did not work. I must miss something here. Please elaborate what you said, Gary. There is not like string.contains or string.match function that can be used.