Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Yog Yog is offline
external usenet poster
 
Posts: 2
Default Combo Box/Drop down box

I know i'm being really dumb here, but i need someone to point out the
obvious to me!!

I am trying to use a combo box where the user selects an option from the box
and is taken to a webpage/document depending on the selection made. The data
range is not very big at all and at the moment is in a column on the very
same sheet, i.e. A12:A23.

I have tried the combo box from the forms toolbar and am fine with the data
range but am having problems when it comes to the VBA. Especially when i am
trying to determine the selection that has been made. I am unable to find the
variable that refers to 'what option has been selected'. I have also tried
using the cell link property but VB does not seem to like #if
Range("b12").value, stating that 'variable not defined'

I then tried the combo box from the control toolbox, but the problem i am
having there is specifying the data range which the combo box refers to.

I am presuming that after this it will be a matter of using the VBA 'Select'
command.

Thanks in advance
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Combo Box/Drop down box

I think using data|validation is the easiest way to implement this kind of
dropdown.

Debra Dalgleish has some very nice instructions he
http://contextures.com/xlDataVal01.html

Then I would add a button from the Forms toolbar that would have a macro
assigned to it.

Option Explicit
Sub testme()

Dim myCell As Range

Set myCell = ActiveSheet.Range("A1") '<-- change the address here.

If IsEmpty(myCell.Value) Then
Beep
Exit Sub 'nothing in the cell
End If

ThisWorkbook.FollowHyperlink myCell.Value
'or maybe...
'ThisWorkbook.FollowHyperlink "Http:\\" & myCell.Value

End Sub

If you decide to use a dropdown from the Forms toolbar or a combobox from the
control toolbox toolbar, you could have code that does the same kind of thing.




Yog wrote:

I know i'm being really dumb here, but i need someone to point out the
obvious to me!!

I am trying to use a combo box where the user selects an option from the box
and is taken to a webpage/document depending on the selection made. The data
range is not very big at all and at the moment is in a column on the very
same sheet, i.e. A12:A23.

I have tried the combo box from the forms toolbar and am fine with the data
range but am having problems when it comes to the VBA. Especially when i am
trying to determine the selection that has been made. I am unable to find the
variable that refers to 'what option has been selected'. I have also tried
using the cell link property but VB does not seem to like #if
Range("b12").value, stating that 'variable not defined'

I then tried the combo box from the control toolbox, but the problem i am
having there is specifying the data range which the combo box refers to.

I am presuming that after this it will be a matter of using the VBA 'Select'
command.

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
Using Drop Down List or Combo Box Dana M Excel Worksheet Functions 9 January 30th 09 02:58 AM
Be able to enter data ALSO in a COMBO BOX drop down Connie Excel Worksheet Functions 1 February 22nd 07 09:15 PM
Centering in a Drop Down Combo Box ray963 Excel Discussion (Misc queries) 0 February 1st 07 05:27 AM
Drop Down List Box, Combo Box ExcelUser777 Excel Discussion (Misc queries) 4 April 9th 06 12:51 AM
How do I print combo box drop down lines? hellma Excel Discussion (Misc queries) 1 April 12th 05 08:32 PM


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