Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 441
Default Get value from a drop down box on a spreadsheet

I have a regular drop down control on a spreadsheet (i.e. NOT an ActiveX) and
I want to get the text that currently appears in the window. This is the type
of control that does not allow yI am sure it is much easier than I'm making
it out to be, but I can't seem to retrieve it. How is it done?

Thanks in advance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 441
Default Get value from a drop down box on a spreadsheet

Sorry, I got interrupted mid-stream, my OP should read:

I have a regular drop down control on a spreadsheet (i.e. NOT an ActiveX) and
I want to get the text that currently appears in the window (i.e. selected).
This is the type of control that does not allow you to edit the box itself,
only to select an item from the drop down. I am sure it is much easier than
I'm making
it out to be, but I can't seem to retrieve it. How is it done?

"quartz" wrote:

I have a regular drop down control on a spreadsheet (i.e. NOT an ActiveX) and
I want to get the text that currently appears in the window. This is the type
of control that does not allow yI am sure it is much easier than I'm making
it out to be, but I can't seem to retrieve it. How is it done?

Thanks in advance.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Get value from a drop down box on a spreadsheet

With Activesheet.Dropdowns("Drop Down 1")
itm = .List(.ListIndex)
End with
msgbox Itm

--
Regards,
Tom Ogilvy


"quartz" wrote in message
...
I have a regular drop down control on a spreadsheet (i.e. NOT an ActiveX)

and
I want to get the text that currently appears in the window. This is the

type
of control that does not allow yI am sure it is much easier than I'm

making
it out to be, but I can't seem to retrieve it. How is it done?

Thanks in advance.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Get value from a drop down box on a spreadsheet

Could you just reset that dropdown?

Option Explicit
Public Function ControlSSDropDownChange()
'POPULATE CELL WITH SHEET CONTROL CONTENTS
Call SheetProtection(ActiveSheet.Name, False)
With ActiveSheet.DropDowns("Drop Down 1")
Cells(ActiveCell.Row, 1) = .List(.ListIndex)
.ListIndex = 0
End With
Call SheetProtection(ActiveSheet.Name, True)
End Function

===

I've never assigned a Function to a control like this. I've always use a sub.
(The function worked fine, though. I just thought it was interesting.)


quartz wrote:

Thanks Tom, however, I still have an issue. The user is forced to make a
selection from this drop down ("Drop Down 1") on a sheet. Once a selection is
made, the choice is to be written into column "A" on the row in which the
cell pointer currently resides.

The problem is, if the drop down already contains "acquatics", for example,
and the user opens the drop down and clicks on "acquatics" as their choice,
nothing happens. But when the user selects something else, then selects
"acquatics" it works. Do you know what I'm doing wrong? My function follows:

Public Function ControlSSDropDownChange()
'POPULATE CELL WITH SHEET CONTROL CONTENTS
Call SheetProtection(ActiveSheet.Name, False)
With ActiveSheet.DropDowns("Drop Down 1")
Cells(ActiveCell.Row, 1) = .List(.ListIndex)
End With
Call SheetProtection(ActiveSheet.Name, True)
End Function

Thanks in advance, once again, for the help.

"Tom Ogilvy" wrote:

With Activesheet.Dropdowns("Drop Down 1")
itm = .List(.ListIndex)
End with
msgbox Itm

--
Regards,
Tom Ogilvy


"quartz" wrote in message
...
I have a regular drop down control on a spreadsheet (i.e. NOT an ActiveX)

and
I want to get the text that currently appears in the window. This is the

type
of control that does not allow yI am sure it is much easier than I'm

making
it out to be, but I can't seem to retrieve it. How is it done?

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
How do I add drop down choices to a spreadsheet? Wendy Excel Worksheet Functions 8 December 22nd 09 05:36 PM
How do I insert a drop down calendar in spreadsheet? ExecAsst1 Excel Worksheet Functions 1 November 13th 09 06:49 PM
Drop down to open a different spreadsheet? Lauren Giles Excel Discussion (Misc queries) 1 February 28th 07 11:55 PM
I need to email my spreadsheet to someone regarding drop down list Leisl Excel Discussion (Misc queries) 3 February 12th 07 09:44 PM
I cannot drag/drop in the spreadsheet Jan Excel Discussion (Misc queries) 1 June 13th 06 10:12 PM


All times are GMT +1. The time now is 06:04 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"