Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 123
Default Select item in dropdown using VBA

Hi,

I have data validation done in a cell. There are ten items in the dropdown
list.

I wish to write a code which selects the item from dropdown as put it in the
cell.

Please help me with a macro which selects fourth itme in the dropdown and
puts it in the cell.

Thanks!
Boss
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Select item in dropdown using VBA

Boss,

For XL2000 onward (split wasn't available in XL97)

Written for the activecell:

ActiveCell.Value = Split(ActiveCell.Validation.Formula1, ",")(3)

Written for a specific cell:

Range("A10").Value = Split(Range("A10").Validation.Formula1, ",")(3)

HTH,
Bernie
MS Excel MVP


"Boss" wrote in message
...
Hi,

I have data validation done in a cell. There are ten items in the dropdown
list.

I wish to write a code which selects the item from dropdown as put it in the
cell.

Please help me with a macro which selects fourth itme in the dropdown and
puts it in the cell.

Thanks!
Boss



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Select item in dropdown using VBA

You are using a Validation List (items displayed in list are from a defined
range such as $Z$1:$Z$10), right? If so, for the active cell...

ActiveCell.Value = Range(ActiveCell.Validation.Formula1)(3).Value

or for a specified cell (say A3)...

Range("A3").Value = Range(Range("A3").Validation.Formula1)(3).Value

--
Rick (MVP - Excel)


"Boss" wrote in message
...
Hi,

I have data validation done in a cell. There are ten items in the dropdown
list.

I wish to write a code which selects the item from dropdown as put it in
the
cell.

Please help me with a macro which selects fourth itme in the dropdown and
puts it in the cell.

Thanks!
Boss


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 123
Default Select item in dropdown using VBA

Thankyou bith for teh reply...
You guys made my day.. !!

Thanks!
Boss

"Boss" wrote:

Hi,

I have data validation done in a cell. There are ten items in the dropdown
list.

I wish to write a code which selects the item from dropdown as put it in the
cell.

Please help me with a macro which selects fourth itme in the dropdown and
puts it in the cell.

Thanks!
Boss

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
select From dropdown and return another dropdown menu RE4379 Excel Discussion (Misc queries) 2 March 11th 10 03:09 PM
User Form with dropdown item Gene Augustin Excel Discussion (Misc queries) 0 February 18th 09 06:35 PM
dropdown box item to display a message grocottg Excel Programming 1 November 19th 08 01:30 PM
Select an item from dropdown list but return value from adjacent c StevanT Excel Discussion (Misc queries) 4 March 17th 07 12:39 PM
How can I set up to chose more than 1 item from a dropdown list (. microchick Excel Discussion (Misc queries) 4 April 7th 05 06:59 PM


All times are GMT +1. The time now is 01:55 PM.

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

About Us

"It's about Microsoft Excel"