Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA Code to read selection from a Validation List
Hi,
Excel 2003. I have a cell on a worksheet that is set up as a dropdown list (Tools Validation List). The list is in Sheet1 at cell A1 and I named the range MyListSelection The data range that populates the dropdown list is called MyListRange (exists on another sheet) From VBA code I am attempting to read the value selected in the MyListSelection but always comes up blank although it displays the selected text from the list. How can I retrieve the selected text in the MyListSelection range? Thanks in advance. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA Code to read selection from a Validation List
Since you're using Data|Validation, the value is right in the cell:
With Worksheets("sheet1") msgbox .range("a1").value end with Greg J wrote: Hi, Excel 2003. I have a cell on a worksheet that is set up as a dropdown list (Tools Validation List). The list is in Sheet1 at cell A1 and I named the range MyListSelection The data range that populates the dropdown list is called MyListRange (exists on another sheet) From VBA code I am attempting to read the value selected in the MyListSelection but always comes up blank although it displays the selected text from the list. How can I retrieve the selected text in the MyListSelection range? Thanks in advance. -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA Code to read selection from a Validation List
Hi Dave,
Thanks for the prompt response. Perhaps in future I should check that my named range is actually pointing to the required cell (duh!). All works fine now. I feel like a bit of a ditz! Dave Peterson wrote: Since you're using Data|Validation, the value is right in the cell: With Worksheets("sheet1") msgbox .range("a1").value end with Greg J wrote: Hi, Excel 2003. I have a cell on a worksheet that is set up as a dropdown list (Tools Validation List). The list is in Sheet1 at cell A1 and I named the range MyListSelection The data range that populates the dropdown list is called MyListRange (exists on another sheet) From VBA code I am attempting to read the value selected in the MyListSelection but always comes up blank although it displays the selected text from the list. How can I retrieve the selected text in the MyListSelection range? Thanks in advance. -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Allow selection of Validation List in a Protected Cell | Excel Discussion (Misc queries) | |||
Display part of list dependant on Validation list selection | Excel Worksheet Functions | |||
List Validation selection | Excel Programming | |||
validation list--list depends on the selection of first list | New Users to Excel | |||
Data Validation list selection question | Excel Worksheet Functions |