Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Programmatically create combo boxes

Does anyone know how to create a combo box in the cell the user clicks on?

If that can't be done, does anyone know how to programmatically create and
array of comboboxes and align them in a column?

Thanks in advance.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Programmatically create combo boxes

You could create and destroy them on the fly, but maybe just creating one and
then moving it where you want it would be sufficient.

I'm not sure if you used a combobox from the Control toolbox toolbar or a
DropDown from the Forms toolbar, so toss the portion you don't want and
uncomment the other.

rightclick on the worksheet tab that should have this behavior and select view
code. Paste this in the codewindow:

Option Explicit

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

' If Intersect(Target, Me.Range("a:a")) Is Nothing Then
' Me.ComboBox1.Visible = False
' Exit Sub
' End If
' Me.ComboBox1.Visible = True
' With Me.ComboBox1
' .Left = Target(1).Left
' .Top = Target(1).Top
' .Width = Target(1).Width
' .Height = Target(1).Height
' End With
'
' If Intersect(Target, Me.Range("a:a")) Is Nothing Then
' Me.DropDowns("drop down 1").Visible = False
' Exit Sub
' End If
' Me.DropDowns("drop down 1").Visible = True
' With Me.DropDowns("drop down 1")
' .Left = Target(1).Left
' .Top = Target(1).Top
' .Width = Target(1).Width
' .Height = Target(1).Height
' End With

End Sub



Richard wrote:

Does anyone know how to create a combo box in the cell the user clicks on?

If that can't be done, does anyone know how to programmatically create and
array of comboboxes and align them in a column?

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
Getting Combo boxes to change options based on other Combo boxes. Ancient Wolf New Users to Excel 1 March 27th 09 06:29 PM
How do I create dependent combo-boxes? ExcelDave Excel Discussion (Misc queries) 3 November 20th 06 02:26 PM
Selecting subsets using combo boxes or list boxes CLamar Excel Discussion (Misc queries) 0 June 1st 06 07:43 PM
Questions on combo boxes and list boxes. Marc New Users to Excel 1 March 14th 06 09:40 AM
List boxes/combo boxes Tibow Excel Programming 3 February 17th 04 12:35 PM


All times are GMT +1. The time now is 10:16 PM.

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"