ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Worksheet and Listbox (https://www.excelbanter.com/excel-programming/378389-worksheet-listbox.html)

steven

Worksheet and Listbox
 
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

Alok

Worksheet and Listbox
 
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



"Steven" wrote:

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


steven

Worksheet and Listbox
 
Not crude at all! That is beautiful. Thank you very much.


All times are GMT +1. The time now is 11:19 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com