Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 389
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 318
Default 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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 389
Default Worksheet and Listbox

Not crude at all! That is beautiful. Thank you very much.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Not allow duplicates from listbox to Worksheet Casey[_96_] Excel Programming 1 June 1st 06 03:50 PM
Help! Activate worksheet from a listbox Bob Phillips Excel Worksheet Functions 0 May 18th 05 09:09 AM
Using a VBA listbox to populate a worksheet Paulc Excel Programming 1 January 28th 05 01:29 PM
How access a listbox on a worksheet AsIs Excel Programming 6 June 21st 04 03:43 AM
listbox.value not equal to listbox.list(listbox.listindex,0) ARB Excel Programming 0 October 22nd 03 12:46 AM


All times are GMT +1. The time now is 11:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"