Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Allow selection of Validation List in a Protected Cell Tonso Excel Discussion (Misc queries) 1 April 14th 10 09:20 PM
Display part of list dependant on Validation list selection Jules73 Excel Worksheet Functions 0 August 12th 09 02:21 PM
List Validation selection Noemi Excel Programming 0 July 13th 06 03:19 AM
validation list--list depends on the selection of first list Michael New Users to Excel 2 April 27th 06 10:23 PM
Data Validation list selection question Bob Wall Excel Worksheet Functions 2 December 4th 04 04:51 PM


All times are GMT +1. The time now is 02:34 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"