Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Transparent combo box NOT! 1

Status
Not open for further replies.

JoJ

Programmer
May 3, 2002
71
CA
I created a combo box, cboAccount, in excel 2K using the control toolbox.

It's backstyle is transparent and it moves along with
the cursor as I go up/down cells in the same column.

To do this, I assign the target range's position to the
combo box in the Worksheet_SelectionChange event.

The problem: after making a choice from the dropdown
list, I want the combo box to remain transparent.
...Not happening!

I found myself going in circles coding
cboAccount.Value = Empty
between combo box and worksheet events. The empty white value still blocks the content of the cell underneath.

Does anyone have a good model solution?
 
V strange, but I have a solution...

First the problem comes from the fact that once you have selected something from your combobox it is still in focus, so you must place the focus somewhere else.

This, however is not enough, you need to force excel to make the combobox transparent again by first turning it opaque, then reseting it to transparent...

Anyway hope this helps:

Range("A1").Select
ComboBox1.BackStyle = fmBackStyleOpaque
ComboBox1.BackStyle = fmBackStyleTransparent
 
Bravo!

It worked. I had to add cboAccount.Value = Empty
after your range select line.

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top