View Single Post
  #43   Report Post  
Posted to microsoft.public.excel.programming
[email protected] ldiowa@gmail.com is offline
external usenet poster
 
Posts: 24
Default Read Dropdown list from Excel column

On Thursday, August 15, 2013 9:09:33 AM UTC-5, isabelle wrote:
hi, Le 2013-08-15 09:15, a écrit : My question is: where can I find my "ValList"? Sub test1() Dim sheet_ValList As String, address_ValList As String sheet_ValList = Range(Sheets("Sheet1").Range("A1").Validation.Form ula1).Parent.Name address_ValList = Range(Sheets("Sheet1")..Range("A1").Validation.For mula1).Address MsgBox sheet_ValList & "!" & address_ValList If Sheets(sheet_ValList).Visible Then Application.Goto Range(sheet_ValList & "!" & address_ValList) Else Sheets(sheet_ValList).Visible = True Application.Goto Range(sheet_ValList & "!" & address_ValList) End If End Sub you help me to show you can programmatically select a item for cell A1? 'eg select the fourth item in the list Sub test2() Sheets("Sheet1").Range("A1") = Range(Sheets("Sheet1").Range("A1").Validation.Form ula1)(4) End Sub isabelle


Hi Isabelle,

Thanks very much for your help again. As I replied to your another post. It seems that dropdown list in my excel file was not named. I ran the code..

string s = oSheet.Range["B11"].Validation.Formula1;

and received the error of "Exception from HRESULT: 0x800A03EC". It means that Formula was not found.