Worksheet and Listbox

G

Guest

I have a listbox and basically what happens is if the user double-clicks the
listbox the listbox value will be copied into the worksheet activecell if the
activecell is in column C. What I do not like is when the cursor is in a
cell in column C and then the user clicks on the listbox the activecell on
the worksheet is not identified with a bold border or anything and the user
cannot really tell which cell they were in until they double-click the
listbox and the listbox value is passed to the ActiveCell.

Question: Is there some way that when you click onto the Listbox that you
can still tell which cell is the activecell on the worksheet.

Thank you for your help.

Steven
 
G

Guest

One crude way of doing it is to put this code in the Selection Change event
of your worksheet and see if it works for you.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

Static c As Range
Static ci As Integer
If Not c Is Nothing Then
c.Interior.ColorIndex = ci
End If
ci = Target.Cells(1).Interior.ColorIndex
Target.Cells(1).Interior.ColorIndex = 36
Set c = Target.Cells(1)

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top