Edit Combo Box code

RAM

Well-known Member
Joined
Oct 4, 2004
Messages
1,862
Hi guys,

I have a Combo Box with the following code:

Private Sub ComboBox1_Click()
'LinkedCell in ToolBox Properties must be unmarked
ActiveSheet.Unprotect
With ComboBox1
If .ListIndex = -1 Then Exit Sub
Range("ac7").Value = IIf(.ListIndex = 0, 1, .Value)
End With
ActiveSheet.Protect
End Sub

After each time I change the value in the drop down the icon for E-mail in the toolbar is grayed out, and I have to click in any part of the sheet to activate the icon again.

What about if we add a “refresh” or “activate” or something to the code for each time I select and that added code has the same effect as when I click on the sheet to activate the E-Mail icon.

Thanks in advance,

RAM
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Hi

You can just select a cell within your code to take the focus from the combobox to the sheet e.g.

Code:
Private Sub ComboBox1_Click()
'LinkedCell in ToolBox Properties must be unmarked
ActiveSheet.Unprotect
With ComboBox1
If .ListIndex = -1 Then Exit Sub
Range("ac7").Value = IIf(.ListIndex = 0, 1, .Value)
End With
ActiveSheet.Protect

Range("F9").Select
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,827
Messages
6,121,824
Members
449,050
Latest member
Bradel

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