Re-Sizing Control Boxes

MazdaRacnChic

New Member
Joined
Aug 27, 2002
Messages
1
How do I get my drop-down menu to re-size to be the same size as the cell in which it is placed? I am creating a worksheet with several different drop-down menus, and I want only the chosen option to appear within the cell. Please Help!
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Hi Racing,

If you are currently using ActiveX comboboxes from the Controls Toolbar to provide your in-cell dropdown, I suggest that you switch to using cell Data > Validation with a List instead. This provides a dropdown which automatically sizes with the cell, is very easy to use and set up, and requires much less memory than a combobox control. To use validation to get an in-cell dropdown, simply select the cell or cells, go to Data > Validation > select List in the Allow dropdown, and in the Source refedit box either type your list separated by commas, or enter a referenct to a range of cells that contains your list.
 
Upvote 0
I use This code trigered to doubleclick in the cell:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Cancel = True
' ComboBox1 must exist on The sheet and be hidden...
Set cb = ComboBox1
ComboBox1.ListFillRange = "Zoznam!2:c100"
' Set position and size of ComboBox1
cb.Width = Target.Width
cb.Height = Target.Height
cb.Top = Target.Top
cb.Left = Target.Left
' Shows combobox
cb.Visible = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,046
Messages
6,122,854
Members
449,096
Latest member
Erald

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top